Sign in to follow this  
Followers 0
Beilby

creating a help message box when F! is pressed

4 posts in this topic

Hi,

I would like to have my application launch a message box with basic help when F1 is pressed on the active application window. So far all attemps have failed.

I could use GUISetHelp to launch notepad with a text file but I would rather have a simple message box

#include <GuiConstants.au3>


GUICreate("My GUI")

$Help = GUISetHelp (MsgBox(32, "Application - Help", "Application displays random information that may be of use sometime." & @CRLF & @CRLF & "If you find some information that is not displayed here please let me know, I might be interested as well" & @CRLF & @CRLF & "Telephone " & @CRLF & "01542 763912"))


GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Help
        Case Else
    EndSelect
WEnd
Exit

Share this post


Link to post
Share on other sites



Hi,

I would like to have my application launch a message box with basic help when F1 is pressed on the active application window. So far all attemps have failed.

I could use GUISetHelp to launch notepad with a text file but I would rather have a simple message box

#include <GuiConstants.au3>


GUICreate("My GUI")

$Help = GUISetHelp (MsgBox(32, "Application - Help", "Application displays random information that may be of use sometime." & @CRLF & @CRLF & "If you find some information that is not displayed here please let me know, I might be interested as well" & @CRLF & @CRLF & "Telephone " & @CRLF & "01542 763912"))


GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Help
        Case Else
    EndSelect
WEnd
Exit

Look up GuiSetHelp because it is not what you say you want.

Assuming the active application is not the script you showed then you need to first use HotKeySet("{F1}","helpFunc") then have a function something like this

Global Const $AppTitle = "whatever the title is for your app"
Func helpFunc()

 If WinGetTitle(WInGetActive("")) = $AppTitle then
 MsgBox(262144,".............
 Else ;not the app so we must replace the stolen F1 key
 HotKeySet("{F1}");so we don't respond to our own F1
 Send("{F1}")
 HotKeySet("{F1}","helpFunc");set hotkey back
 EndIf



endfunc

If the app is your script then I think it would be better to use an accelerator key instead of a hotkey.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

HotKeySet("{F1}", "Help")

Func help()
      mesagebox(64,"Testing Help","1,2,3")
EndFunc

defines F1 as a hotkey so when it's pressed, it executes the help function


There are 10 kinds of people, those who understand me and those who don't.

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