Jump to content

Autoıt Msgbox Buton Yazılarını Değiştirme


ClapTonApp
 Share

Recommended Posts

basit guı oluştur msgbox gibi oda işini görür ,autoit ile kod bilginiz anladığım kadarıyla az

peki ben kodları versem editleme yapabilecekmisiniz :D

küçümseme manasında demedim ,nasıl editleme yapacağınız konusunda size nasıl yardımcı olabilirim onu düşündüm .

Link to comment
Share on other sites

basit guı oluştur msgbox gibi oda işini görür ,autoit ile kod bilginiz anladığım kadarıyla az

peki ben kodları versem editleme yapabilecekmisiniz :D

küçümseme manasında demedim ,nasıl editleme yapacağınız konusunda size nasıl yardımcı olabilirim onu düşündüm .

Aslında az değil,o manada anlamadım,ne demek :D ,editlerim bir şekilde,şimdiden teşekkür ediyorum :D

Edited by ClapTonApp
Link to comment
Share on other sites


$MsgBoxValue = _MsgBoxChangeButtons(35, 'This is my msgbox', 'This' & @CRLF & 'Should' & @CRLF & 'Work', 'ReBoot', 'Continue', 'Cancel', 20, 1)
If $MsgBoxValue = 6 Then MsgBox(0, 'Clicked', 'You clicked the ReBoot Button')
If $MsgBoxValue = -1 Then MsgBox(0, 'Time out', 'The time is out, the default button was pressed')

Func _MsgBoxChangeButtons($iFlag, $sTitle, $sText, $sButton1, $sButton2 = '', $sButton3 = '', $iMBTimeOut = 0, $DefButtonTO = 1)
    Local $MBFile = FileOpen(@TempDir & '\MiscMMB.txt', 2)
    Local $MBLine = '#NoTrayIcon' & @CRLF
    $MBLine &= 'While Not WinExists("' & $sTitle & '")' & @CRLF
    $MBLine &= '    Sleep(10)' & @CRLF
    $MBLine &= 'WEnd' & @CRLF
    $MBLine &= 'ControlSetText("' & $sTitle & '", "", "Button1", "' & $sButton1 & '")' & @CRLF
    If $sButton2 <> '' Then $MBLine &= 'ControlSetText("' & $sTitle & '", "", "Button2", "' & $sButton2 & '")' & @CRLF
    If $sButton3 <> '' Then $MBLine &= 'ControlSetText("' & $sTitle & '", "", "Button3", "' & $sButton3 & '")' & @CRLF
    
    Switch $DefButtonTO
        Case 1
            $ButtonToSet = $sButton1
        Case 2
            $ButtonToSet = $sButton2
        Case 3
            $ButtonToSet = $sButton3
        Case Else
            $ButtonToSet = $sButton1
    EndSwitch
    
    If $iMBTimeOut > 0 Then
        $MBLine &= '$TimerInit = TimerInit()' & @CRLF & 'While (TimerDiff($TimerInit) / 1000) < ' & $iMBTimeOut & _
            @CRLF & '   ControlSetText("' & $sTitle & '", "", "Button' & $DefButtonTO & '", "' & $ButtonToSet & _
                ' (" & ' & $iMBTimeOut & ' - Round(TimerDiff($TimerInit)/1000) & ")")' & @CRLF & _
                '   If Not WinExists("' & $sTitle & '") Then ExitLoop' & @CRLF & 'WEnd'
    EndIf
    
    FileWrite(@TempDir & '\MiscMMB.txt', $MBLine)
    
    $MBPID1 = Run(@AutoItExe & ' /AutoIt3ExecuteScript ' & @TempDir & '\MiscMMB.txt')
    $MBBox = MsgBox($iFlag, $sTitle, $sText, $iMBTimeOut)
    FileClose($MBFile)
    Do
        FileDelete(@TempDir & '\MiscMMB.txt')
    Until Not FileExists(@TempDir & '\MiscMMB.txt')
    Return $MBBox
EndFunc

http://www.autoitscript.com/forum/topic/27485-msgbox-customized-anwsers/page-2
http://www.autoitscript.com/forum/topic/92903-advanced-message-box-udf-lib/

konularını inceleyiniz

Edited by mesale0077
Link to comment
Share on other sites


$MsgBoxValue = _MsgBoxChangeButtons(35, 'This is my msgbox', 'This' & @CRLF & 'Should' & @CRLF & 'Work', 'ReBoot', 'Continue', 'Cancel', 20, 1)
If $MsgBoxValue = 6 Then MsgBox(0, 'Clicked', 'You clicked the ReBoot Button')
If $MsgBoxValue = -1 Then MsgBox(0, 'Time out', 'The time is out, the default button was pressed')

Func _MsgBoxChangeButtons($iFlag, $sTitle, $sText, $sButton1, $sButton2 = '', $sButton3 = '', $iMBTimeOut = 0, $DefButtonTO = 1)
    Local $MBFile = FileOpen(@TempDir & '\MiscMMB.txt', 2)
    Local $MBLine = '#NoTrayIcon' & @CRLF
    $MBLine &= 'While Not WinExists("' & $sTitle & '")' & @CRLF
    $MBLine &= '    Sleep(10)' & @CRLF
    $MBLine &= 'WEnd' & @CRLF
    $MBLine &= 'ControlSetText("' & $sTitle & '", "", "Button1", "' & $sButton1 & '")' & @CRLF
    If $sButton2 <> '' Then $MBLine &= 'ControlSetText("' & $sTitle & '", "", "Button2", "' & $sButton2 & '")' & @CRLF
    If $sButton3 <> '' Then $MBLine &= 'ControlSetText("' & $sTitle & '", "", "Button3", "' & $sButton3 & '")' & @CRLF
    
    Switch $DefButtonTO
        Case 1
            $ButtonToSet = $sButton1
        Case 2
            $ButtonToSet = $sButton2
        Case 3
            $ButtonToSet = $sButton3
        Case Else
            $ButtonToSet = $sButton1
    EndSwitch
    
    If $iMBTimeOut > 0 Then
        $MBLine &= '$TimerInit = TimerInit()' & @CRLF & 'While (TimerDiff($TimerInit) / 1000) < ' & $iMBTimeOut & _
            @CRLF & '   ControlSetText("' & $sTitle & '", "", "Button' & $DefButtonTO & '", "' & $ButtonToSet & _
                ' (" & ' & $iMBTimeOut & ' - Round(TimerDiff($TimerInit)/1000) & ")")' & @CRLF & _
                '   If Not WinExists("' & $sTitle & '") Then ExitLoop' & @CRLF & 'WEnd'
    EndIf
    
    FileWrite(@TempDir & '\MiscMMB.txt', $MBLine)
    
    $MBPID1 = Run(@AutoItExe & ' /AutoIt3ExecuteScript ' & @TempDir & '\MiscMMB.txt')
    $MBBox = MsgBox($iFlag, $sTitle, $sText, $iMBTimeOut)
    FileClose($MBFile)
    Do
        FileDelete(@TempDir & '\MiscMMB.txt')
    Until Not FileExists(@TempDir & '\MiscMMB.txt')
    Return $MBBox
EndFunc

Düzenledim,msgbox 35 yerine 36 kullanıyorum cancele ihtiyaç yok :D , çok teşekkür ederim.

Edited by ClapTonApp
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...