Beilby Posted February 18, 2010 Posted February 18, 2010 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
martin Posted February 18, 2010 Posted February 18, 2010 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.
BrettF Posted February 18, 2010 Posted February 18, 2010 GUISetAccelerators? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
akfourtyseven Posted February 18, 2010 Posted February 18, 2010 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.
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