Sign in to follow this  
Followers 0
FireFox

Make on event help button

7 posts in this topic

Hi,

Ive made gui with help button |?| and Ive looked In GUIConstantsEx and found nothing about make it on event...

Ive searched in forum but I always found words split like "help" and after "button" ...

Thanks for anyhelp.

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



I don't get what you want, are you looking for GUISetHelp or what? Please explain what you are looking for.

Share this post


Link to post
Share on other sites

@Pain

I want to make on event the help button (like the close button with $GUI_EVENT_CLOSE)

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

You need WM_HELP (no good example, but the concept should be clear:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StructureConstants.au3>
Global Const $tagHELPINFO = _
    "UINT cbSize;" & _
    "int iContextType;" & _
    "int iCtrlId;" & _
    "HWND hItemHandle;" & _
    "DWORD dwContextId;" & _
    "int MousePos[2];"

Opt('MustDeclareVars', 1)

Example1()

; example 1
Func Example1()
    Local $msg

    GUICreate("My GUI",400,400,-1,-1,0x00C00000+0x00080000,$WS_EX_CONTEXTHELP) ; will create a dialog box that when displayed is centered
    GUISetState(@SW_SHOW) ; will display an empty dialog box
    GUISetHelp("C:\Programme\AutoIt3\AutoIt3Help.exe")
    GUICtrlCreateButton("jkjk",10,10)
    Local $dwContextHelpId = 1234
    DllCall("user32.dll","int","SetWindowContextHelpId","hWnd",GUICtrlGetHandle(-1),"dword",$dwContextHelpId)
    GUIRegisterMsg($WM_HELP,"WM_HELP")
    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()

        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    GUIDelete()
EndFunc   ;==>Example1

Func WM_HELP($hWnd,$uMsg,$wParm,$lParam)
    Local $HELPINFO = DllStructCreate($tagHELPINFO,$lParam)
    ConsoleWrite("----------------------------" & @CRLF)
    ConsoleWrite(DllStructGetData($HELPINFO,"iContextType") & @CRLF)
    ConsoleWrite(DllStructGetData($HELPINFO,"dwContextId") & @CRLF)
EndFunc

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

@ProgAndy

Thanks but after I click on help button I have to click on anycontrol to have my function...

What I want is like when I click on help button I have my function on event without click anywhere...

Example :

GuiSetOnEvent($GUI_EVENT_HELP, "_Help")

Thanks for anyhelp.

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

@ProgAndy

Thanks but after I click on help button I have to click on anycontrol to have my function...

What I want is like when I click on help button I have my function on event without click anywhere...

Example :

GuiSetOnEvent($GUI_EVENT_HELP, "_Help")

Thanks for anyhelp.

Cheers, FireFox.

@FireFox

ProgAndy's example is for the proper context sensitive help usage of that button.

you need to block the mouse capture of that mode and call your own function using WM_SYSCOMMAND message.

if you want to use this button you lose the minimize maximize buttons.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StructureConstants.au3>

Global Const $SC_CONTEXTHELP = 0xF180

Opt('MustDeclareVars', 1)
Opt("GUIOnEventMode", 1)

Global $SysMenuDummy
Example1()

; example 1
Func Example1()
    Local $msg
    GUICreate("My GUI", 400, 400, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU), $WS_EX_CONTEXTHELP);$WS_EX_CONTEXTHELP Cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Events")
    $SysMenuDummy = GUICtrlCreateDummy()
    GUICtrlSetOnEvent(-1, "_Events")
    GUISetState(@SW_SHOW)
    GUIRegisterMsg($WM_SYSCOMMAND, "_WM_SYSCOMMAND")

    While 1
        Sleep(1000)
        $msg = GUIGetMsg()
    WEnd
    
EndFunc  ;==>Example1

Func _Events()
    Switch @GUI_CtrlId
        Case $GUI_EVENT_CLOSE
            GUIDelete()
            Exit
        Case $SysMenuDummy
            MsgBox(262144, "Help", "Yes?, How can I help you?")
    EndSwitch
EndFunc  ;==>_Events

Func _WM_SYSCOMMAND($hWnd, $msg, $wParam, $lParam)
    #forceref $hWnd, $Msg, $wParam, $lParam
    $wParam = Number($wParam)
    If $wParam = $SC_CONTEXTHELP Then
        GUICtrlSendToDummy($SysMenuDummy, $wParam)
        Return ""
    EndIf
    Return $GUI_RUNDEFMSG
EndFunc  ;==>_WM_SYSCOMMAND

I see fascists...

Share this post


Link to post
Share on other sites

@rover

if you want to use this button you lose the minimize maximize buttons.

No problem, it works; thanks :)

 

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