Sign in to follow this  
Followers 0
HAL9000

Example of $WS_EX_CONTEXTHELP

7 posts in this topic

#1 ·  Posted (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 by HAL9000

Share this post


Link to post
Share on other sites



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


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Nice example!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

#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 by AZJIO
1 person likes this

Share this post


Link to post
Share on other sites

how would you do this Guictrlsetonevent?

Share this post


Link to post
Share on other sites

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.

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0