Jump to content

Go to solution Solved by argumentum,

Recommended Posts

..and I asked myself, how will it run in another language ?, about Win 7 ?. So I installed Win7 in Spanish. Much easier than French or Korean for me.

Spoiler

Win10_French_SelfCert_Show.png.9225c7349 Win10_korean_SelfCert_Show.png.96de4b49d

from testing CertSigner 0.2021.12.23

then am like I'll add this and that and, oh, let's show the errors to DClick in SciTE and jump to the function. Let's make it child proof. A teaching UDF.
Well, is a patch after a patch. I thought of adding BttnEnableIndependently() and I said ( to my self ), stop. So I added ControlEnable($HWnd, .. to the example.

I should have code it ... differently, but I hope it answers questions like -as I said above- how can I make the error jump to the file with the code other than the current script.

Has the ReturnMeaning  ( IDTIMEOUT ). I thought it'd be good. I hope it brings ideas to those that could use something like this.

I know that I don't have use for it. Good old MsgBox is enough, ... and even that I ever use.

Edited by argumentum
and edited that post like for 10 minutes as I remember I forgot to code this or that. lol

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

  • Solution
#include <MsgBox_Extn.au3> ; https://www.autoitscript.com/forum/index.php?showtopic=211523
#include <windowsconstants.au3> ; $WM_HELP = 0x0053

Global Const $tagHELPINFO = "UINT cbSize;int iContextType;int iCtrlId;HWND hItemHandle;DWORD dwContextId;int MousePos[2];"

Example()
Func Example()
    ; https://www.autoitscript.com/forum/topic/86797-make-on-event-help-button/?do=findComment&comment=622428 ; ..code for the help in the caption bar.
    Local $hGUI = GUICreate(StringTrimRight(@ScriptName, 4) & " - Example", 400, 100, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU), $WS_EX_CONTEXTHELP)
    GUICtrlCreateButton("This button does something, but what does it do ?.", 10, 10)
    Local $dwContextHelpId = 1234
    ConsoleWrite('- hButton: ' & GUICtrlGetHandle(-1) & @CRLF)
    DllCall("user32.dll", "int", "SetWindowContextHelpId", "hWnd", GUICtrlGetHandle(-1), "dword", $dwContextHelpId)
    GUISetState()

    ; https://www.autoitscript.com/forum/topic/87097-msgbox-new-hwnd-param-not-working/?do=findComment&comment=624928
    GUIRegisterMsg($WM_HELP, "HelpMePlz") ; Original post.

    ;                           It has to have a GUI to get the message from the MsgBox help button.
    _MsgBox_Extn(0, BitOR($MB_TOPMOST, $MB_OKCANCEL, $MB_HELP), "My title", "My Message", 60, $hGUI)
    ToolTip("")

    Do
    Until GUIGetMsg() = -3

EndFunc   ;==>Example

Func HelpMePlz($hWnd, $Msg, $wParam, $lParam)
    ConsoleWrite('+ Func help(' & $hWnd & ', ' & $Msg & ', ' & $wParam & ', ' & $lParam & ')' & @CRLF)
    Local $HELPINFO = DllStructCreate($tagHELPINFO, $lParam)
    ConsoleWrite('- iContextType: ' & DllStructGetData($HELPINFO, "iContextType") & @TAB)
    ConsoleWrite(' - hItemHandle: ' & DllStructGetData($HELPINFO, "hItemHandle") & @TAB) ; this way ( w/ callback ) for the MsgBox
    ConsoleWrite(' - dwContextId: ' & DllStructGetData($HELPINFO, "dwContextId") & @CRLF & @CRLF) ; this way for a GUI Ctrl

    If DllStructGetData($HELPINFO, "dwContextId") = 1234 Then
        ToolTip("I need help on this Button!")
    Else
        ToolTip("I need help in the MsgBox!")
    EndIf

    Return "GUI_RUNDEFMSG"
EndFunc   ;==>HelpMePlz

What good would a "Help" button be if it does nothing. In the example above it does something.
Need not be used with this UDF only. All the example shows is that you can "GUIRegisterMsg($WM_HELP,..." and catch it.

image.png

Also, help on the caption bar " ? " button.

Edited by argumentum
more

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

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

×
×
  • Create New...