HAL9000 Posted January 1, 2009 Posted January 1, 2009 (edited) #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $hGUI = GUICreate("$WS_EX_CONTEXTHELP ----------------------------------> CLICK ?", 400, 300,-1,-1,$WS_SYSMENU, $WS_EX_CONTEXTHELP) GUIRegisterMsg($WM_SYSCOMMAND, "help") GUISetState() while 1 wend func help($hWnd, $Msg, $wParam, $lParam) if $wParam=0x0000F180 then GUICtrlCreateLabel("$WS_EX_CONTEXTHELP",10,10,130,30) msgbox (64,"$WS_EX_CONTEXTHELP","$WS_EX_CONTEXTHELP") Return "" EndIf if $wParam=0x0000F060 then exit Return $GUI_RUNDEFMSG endfunc Edited January 1, 2009 by HAL9000
FireFox Posted January 1, 2009 Posted January 1, 2009 @HAL9000 Nice one I think this is the one you gave me : #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GuiOnEventMode", 1) Global Const $SC_CONTEXTHELP = 0xF180 $hGUI = GUICreate("$WS_EX_CONTEXTHELP -------------------------------> CLICK ?", 400, 300, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU), $WS_EX_CONTEXTHELP) GUIRegisterMsg($WM_SYSCOMMAND, "_WM_SYSCOMMAND") $Dummy = GUICtrlCreateDummy() GUICtrlSetOnEvent(-1, "_Help") GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUISetState(@SW_SHOW, $hGUI) While 1 Sleep(250) WEnd Func _Help() MsgBox(64, "Help", "Help !") EndFunc ;==>_Help Func _Exit() Exit EndFunc Func _WM_SYSCOMMAND($hwnd, $msg, $wParam, $lParam) $wParam = Number($wParam) If $wParam = $SC_CONTEXTHELP Then GUICtrlSendToDummy($Dummy, $wParam) Return "" EndIf Return $GUI_RUNDEFMSG EndFunc ;==>_WM_SYSCOMMAND Cheers, FireFox.
AZJIO Posted April 18, 2012 Posted April 18, 2012 (edited) expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $TrHelp = 0 $Gui = GUICreate("WS_EX_CONTEXTHELP", 440, 270, -1, -1, BitOR($WS_SYSMENU, $WS_CAPTION), $WS_EX_CONTEXTHELP) $iHelp = GUICtrlCreateLabel('Text 1.', 25, 25, 430, 17) $iData = GUICtrlCreateLabel('Text 2', 25, 65, 430, 17) $iButton = GUICtrlCreateButton('Button', 10, 100, 70, 25) GUISetState() GUIRegisterMsg($WM_SYSCOMMAND, "WM_SYSCOMMAND") While 1 $msg = GUIGetMsg() If $TrHelp Then $a = GUIGetCursorInfo() Switch $a[4] Case $iButton ToolTip('It is the button') Case $iHelp ToolTip('It is the label 1') Case $iData ToolTip('It is the label 2') EndSwitch AdlibRegister('_CloseToolTip', 2000) $TrHelp = 0 ContinueLoop EndIf Switch $msg Case $iButton GUICtrlSetData($iData, 'Done') Case -3 Exit EndSwitch WEnd Func _CloseToolTip() AdlibUnRegister('_CloseToolTip') ToolTip('') EndFunc ;==>_CloseToolTip Func WM_SYSCOMMAND($hWnd, $msg, $wParam, $lParam) If BitAND($wParam, 0xFFFF) = 0xF180 Then $TrHelp = 1 Return $GUI_RUNDEFMSG EndFunc ;==>WM_SYSCOMMAND Edited December 16, 2012 by AZJIO VenusProject2 1 My other projects or all
RogFleming Posted December 16, 2012 Posted December 16, 2012 how would you do this Guictrlsetonevent?
FireFox Posted December 16, 2012 Posted December 16, 2012 On 12/16/2012 at 3:56 PM, 'RogFleming said: how would you do this Guictrlsetonevent?This is not a control event, but a window event. You need to use the $WM_SYSCOMMAND message used in the examples above.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now