Jump to content

Modify MsgBox buttons


 Share

Recommended Posts

I couldn't find this in the support forums, but if anyone knows let me know.

Is there a way to get the MsgBox to have different buttons than the default Yes and No and Cancel.

I want the buttons to say something like Enable, Disable, and Quit.

Anyone know if this is possible? Thanks.

-- If the apocalypse comes... beep me.

Link to comment
Share on other sites

You can always make your own msgbox and call the buttons whatever you want


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

  • Moderators

Hmm, this was fun

$iMsg = _MsgBoxEx(0, 'nothing', 'something', 0, 'Button1', 'Changed')
MsgBox(64, 'Info', 'The Return Was: ' & $iMsg)

Func _MsgBoxEx($iFlag, $sTitle, $sText, $iTime = 0, $sCID = '', $sCIDChange = '')
    Local $_MsgBox_ = """ConsoleWrite(MsgBox(" & $iFlag & ', ""' & $sTitle & '"", ""' & $sText & '"", ' & $iTime & '"))'
    Local $iPID = Run(@AutoItExe & ' /AutoIt3ExecuteLine ' & $_MsgBox_, '', @SW_SHOW, 6)
    Do
        Sleep(10)
    Until WinExists($sTitle)
    If IsArray($sCID) Then
        For $iCC = 1 To UBound($sCID) - 1
            ControlSetText($sTitle, '', $sCID[$iCC], $sCIDChange)
        Next
    Else
        ControlSetText($sTitle, '', $sCID, $sCIDChange)
    EndIf
    While ProcessExists($iPID)
        Local $iStdOut = StdoutRead($iPID)
        If Number($iStdOut) > 0 Then Return $iStdOut
        Sleep(10)
    WEnd
EndFuncoÝ÷ ØGb´v¶!jxÖÖ®¶­sdÆö6Âb33c´6ævUFWE³5ÒÒ²b33²b33²Âb33´6ævVBb33²Âb33´6ævVC"b33µÐ¢b33c¶×6rÒô×6t&÷WcÂb33¶æ÷Færb33²Âb33·6öÖWFærb33²ÂÂb33c´6ævUFWB¤×6t&÷cBÂb33´æfòb33²Âb33µFR&WGW&âv3¢b33²fײb33c¶×6r ¤gVæ2ô×6t&÷Wb33c¶fÆrÂb33c·5FFÆRÂb33c·5FWBÂb33c¶FÖRÒÂb33c·44D6ævRÒb33²b33² Æö6Âb33cµô×6t&÷òÒgV÷C²gV÷C²gV÷C´6öç6öÆUw&FR×6t&÷gV÷C²fײb33c¶fÆrfײb33²ÂgV÷C²gV÷C²b33²fײb33c·5FFÆRfײb33²gV÷C²gV÷C²ÂgV÷C²gV÷C²b33²fײb33c·5FWBfײb33²gV÷C²gV÷C²Âb33²fײb33c¶FÖRfײb33²gV÷C²b33° Æö6Âb33c¶BÒ'VâWFôDWRfײb33²ôWFôC4WV7WFTÆæRb33²fײb33cµô×6t&÷òÂb33²b33²Â5uõ4õrÂb Fð 6ÆVW VçFÂväW7G2b33c·5FFÆR b4'&b33c·44D6ævRFVà f÷"b33c¶42ÒFòT&÷VæBb33c·44D6ævRÒ 6öçG&öÅ6WEFWBb33c·5FFÆRÂb33²b33²Âb33´'WGFöâb33²fײb33c¶42Âb33c·44D6ævU²b33c¶45Ò æW@ VÇ6P 6öçG&öÅ6WEFWBb33c·5FFÆRÂb33²b33²Âb33´'WGFöãb33²Âb33c·44D6ævR VæD` vÆR&ö6W74W7G2b33c¶B Æö6Âb33c¶7FD÷WBÒ7FF÷WE&VBb33c¶B bçVÖ&W"b33c¶7FD÷WBfwC²FVâ&WGW&âb33c¶7FD÷W@ 6ÆVW tVæ@¤VæDgVæ

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Saw you pondering around in here, ... was this not what you were looking for?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Hmm, this was fun

$iMsg = _MsgBoxEx(0, 'nothing', 'something', 0, 'Button1', 'Changed')
MsgBox(64, 'Info', 'The Return Was: ' & $iMsg)

Func _MsgBoxEx($iFlag, $sTitle, $sText, $iTime = 0, $sCID = '', $sCIDChange = '')
    Local $_MsgBox_ = """ConsoleWrite(MsgBox(" & $iFlag & ', ""' & $sTitle & '"", ""' & $sText & '"", ' & $iTime & '"))'
    Local $iPID = Run(@AutoItExe & ' /AutoIt3ExecuteLine ' & $_MsgBox_, '', @SW_SHOW, 6)
    Do
        Sleep(10)
    Until WinExists($sTitle)
    If IsArray($sCID) Then
        For $iCC = 1 To UBound($sCID) - 1
            ControlSetText($sTitle, '', $sCID[$iCC], $sCIDChange)
        Next
    Else
        ControlSetText($sTitle, '', $sCID, $sCIDChange)
    EndIf
    While ProcessExists($iPID)
        Local $iStdOut = StdoutRead($iPID)
        If Number($iStdOut) > 0 Then Return $iStdOut
        Sleep(10)
    WEnd
EndFuncoÝ÷ ØGb´v¶!jxÖÖ®¶­sdÆö6Âb33c´6ævUFWE³5ÒÒ²b33²b33²Âb33´6ævVBb33²Âb33´6ævVC"b33µÐ¢b33c¶×6rÒô×6t&÷WcÂb33¶æ÷Færb33²Âb33·6öÖWFærb33²ÂÂb33c´6ævUFWB¤×6t&÷cBÂb33´æfòb33²Âb33µFR&WGW&âv3¢b33²fײb33c¶×6r ¤gVæ2ô×6t&÷Wb33c¶fÆrÂb33c·5FFÆRÂb33c·5FWBÂb33c¶FÖRÒÂb33c·44D6ævRÒb33²b33² Æö6Âb33cµô×6t&÷òÒgV÷C²gV÷C²gV÷C´6öç6öÆUw&FR×6t&÷gV÷C²fײb33c¶fÆrfײb33²ÂgV÷C²gV÷C²b33²fײb33c·5FFÆRfײb33²gV÷C²gV÷C²ÂgV÷C²gV÷C²b33²fײb33c·5FWBfײb33²gV÷C²gV÷C²Âb33²fײb33c¶FÖRfײb33²gV÷C²b33° Æö6Âb33c¶BÒ'VâWFôDWRfײb33²ôWFôC4WV7WFTÆæRb33²fײb33cµô×6t&÷òÂb33²b33²Â5uõ4õrÂb Fð 6ÆVW VçFÂväW7G2b33c·5FFÆR b4'&b33c·44D6ævRFVà f÷"b33c¶42ÒFòT&÷VæBb33c·44D6ævRÒ 6öçG&öÅ6WEFWBb33c·5FFÆRÂb33²b33²Âb33´'WGFöâb33²fײb33c¶42Âb33c·44D6ævU²b33c¶45Ò æW@ VÇ6P 6öçG&öÅ6WEFWBb33c·5FFÆRÂb33²b33²Âb33´'WGFöãb33²Âb33c·44D6ævR VæD` vÆR&ö6W74W7G2b33c¶B Æö6Âb33c¶7FD÷WBÒ7FF÷WE&VBb33c¶B bçVÖ&W"b33c¶7FD÷WBfwC²FVâ&WGW&âb33c¶7FD÷W@ 6ÆVW tVæ@¤VæDgVæ
Nice. Very cool. Thanks. :P

-- If the apocalypse comes... beep me.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...