Jump to content

MsgBox & $MB_HELP button


Recommended Posts

Hi everybody :)

I never used the 4th button of MsgBox, so I wanted to try it to see if this "Help" button was simple to use.
Here is what I scripted so far, simple but that's a start :

#include <AutoItConstants.au3>
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>

Global $hGUI = GUICreate("My Gui", 500, 300)

GUISetState()
GUIRegisterMsg($WM_HELP, "WM_HELP")

MsgBox(BitOr($MB_CANCELTRYCONTINUE, $MB_HELP, $MB_TOPMOST), "Click Help button", "Text", 0, $hGUI)
ToolTip("")

;===========================================
Func WM_HELP($hWnd, $iMsg, $wParam, $lParam)
    #forceref $iMsg, $wParam, $lParam

    If $hWnd = $hGUI Then
        ToolTip("- Cancel means..." & @CR & "  etc..." & @CR & @CR & _
                "- Try Again means..." & @CR & "  etc..." & @CR & @CR & _
                "- Continue means..." & @CR & "  etc...", Default, Default, "", 0, $TIP_BALLOON)
    EndIf
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_HELP

MsgBoxhelpbutton(normalbehavior).png.bce0e1e68bea026dc900b9a4a1218d1a.png

This was the normal behavior of the 4th button, but personnaly I'm using it in a "non-normal" way, as shown in the pic below, where a click on the 4th button closes the MsgBox and lets the user know that the 4th button was clicked

MsgBoxhelpbutton(alteredbehavior).png.3a49e4f2600f1f867b8f24d3b3b91016.png

I'll explain in another (already existing) post how I did that, in case some users are interested, with this kind of pic & new explanations to come, the problem is I modify the explanations daily !

552-MsgBoxwithalteredcaptions(Forum).png.4f3f84792236daea817812d905f8773a.png

Thanks to @funkey for his post found here

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...