akfourtyseven Posted February 21, 2009 Share Posted February 21, 2009 I have made a GUI program and made it display the help file when the help button is pressed or when F1 is pressed. The problem is, when you press F1 it opens the help file multiple times depending on how long you pressed it. Is there any way to fix this, and here is the code (I left out irrelevant parts) $GUIWidth = 450 $GUIHeight = 320 $helpmenu = GuiCtrlCreateMenu ("Help") $helptopics = GUICtrlCreateMenuitem ("Help Topics F1",$helpmenu) $dll = DllOpen("user32.dll") While 1 $msg = GUIGetMsg() Select Case $msg = $Helptopics or _IsPressed("70", $dll) ShellExecute("help\help.chm","","","",@SW_MAXIMIZE) EndSelect WEnd DllClose($dll) There are 10 kinds of people, those who understand me and those who don't. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted February 21, 2009 Share Posted February 21, 2009 In this case it would be better ot use HotKeySet() or GUISetAccelerators(), see helpfile .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
akfourtyseven Posted February 21, 2009 Author Share Posted February 21, 2009 In this case it would be better ot use HotKeySet() or GUISetAccelerators(), see helpfileThanx man! But I have no Idea Can you show me how to insert the function? There are 10 kinds of people, those who understand me and those who don't. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted February 21, 2009 Share Posted February 21, 2009 Thanx man! But I have no Idea Can you show me how to insert the function?Try the examples in the helpfile, they are really easy if you look at them .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
akfourtyseven Posted February 21, 2009 Author Share Posted February 21, 2009 Try the examples in the helpfile, they are really easy if you look at themThanx man! I have figured it out! There are 10 kinds of people, those who understand me and those who don't. Link to comment Share on other sites More sharing options...
ChangMinYang Posted February 21, 2009 Share Posted February 21, 2009 I have made a GUI program and made it display the help file when the help button is pressed or when F1 is pressed. The problem is, when you press F1 it opens the help file multiple times depending on how long you pressed it. Is there any way to fix this, and here is the code (I left out irrelevant parts) $GUIWidth = 450 $GUIHeight = 320 $helpmenu = GuiCtrlCreateMenu ("Help") $helptopics = GUICtrlCreateMenuitem ("Help Topics F1",$helpmenu) $dll = DllOpen("user32.dll") While 1 $msg = GUIGetMsg() Select Case $msg = $Helptopics or _IsPressed("70", $dll) ShellExecute("help\help.chm","","","",@SW_MAXIMIZE) EndSelect WEnd DllClose($dll) If ProcessExists( "hh.exe" ) < 1 Then ShellExecute ... EndIf Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 21, 2009 Moderators Share Posted February 21, 2009 akfourtyseven,Use the builtin Autoit function GUISetHelp - this is what it was designed for!M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Euler G. Posted March 3, 2018 Share Posted March 3, 2018 On 21/02/2009 at 10:41 AM, Melba23 said: akfourtyseven, Use the builtin Autoit function GUISetHelp - this is what it was designed for! M23 Melba23, I'm trying to address a context sensitive help. I already found a piece of code on forum that I adapted to my needs but still struggling with call the right CHM index if focus is on an input field or other control. Here is the function I'm using (it's a quick'n'dirty prototype): ; ---------------------------------------- ; Calls HTML help file (.CHM), given: ; help file name (only) - defaults to @ScriptName with chm extension ; Help file path (only) - defaults to @ScriptDir ; Opens help file at the givem section if both exist. ; Example: _NavigateCHM("/html/hs41.htm") ; ---------------------------------------- Func _NavCHM($sSection, $sFilePath = @ScriptDir, $sFileName = StringTrimRight(@ScriptName, 3) & "chm") Local $hWnd = WinWait('[TITLE:' & $sTitle & ' - complementary HTML Help title; CLASS:HH Parent]', "", 5) If StringLeft($sSection, 6) <> "/html/" Then $sSection = "/html/" & $sSection If StringRight($sSection, 4) <> ".htm" Then $sSection &= ".htm" If IsHWnd($hWnd) Then ; Help already open WinActivate($hWnd) Local $oIE = _IEAttach($sTitle & ' - complementary HTML Help title', 'Embedded') _IENavigate($oIE, 'mk:@MSITStore:' & $sFilePath & '\' & $sFileName & '::' & $sSection) Else Run('"' & @WindowsDir & '\' & 'hh.exe" "' & $sFilePath & '\' & $sFileName & '::' & $sSection & '"') EndIf EndFunc ;==>_NavCHM As said already, I found this code here but forgot the author(s). I just want to acknowledge their job and I'm grateful they shared their solution. Back to GUISetHelp(), could it be used with any GUI handle or just that from GUICreate()? Or maybe I should look into HotKeySet() to call _NavCHM with the proper CHM section reference. TIA for any hints. Best, Euler Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 3, 2018 Moderators Share Posted March 3, 2018 @Euler G. did you happen to notice this thread is over 9 years old?? Please don't resurrect old threads. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Euler G. Posted March 4, 2018 Share Posted March 4, 2018 Yes, I did. It was about a matter for which I seek for a solution and it wasn't closed. Should I have opened another thread about the same matter? Best, Euler Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted March 4, 2018 Moderators Share Posted March 4, 2018 Typically, it is better to start your own thread rather than commandeer someone else's yes. And we try to avoid resurrecting very old threads as the language continues to grow and evolve. What may have worked 2 or 3 (or 9) years ago may not work the same today. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Euler G. Posted March 8, 2018 Share Posted March 8, 2018 @JLogan3o13 Thanks for your clarification and heads-up. I could start a new post and make a reference to this one (pointed to me by the search engine) but I thought it could be seen as a violation to forum rules. I'll try to be more careful. As Melba23, I'm also old. Best, Euler Link to comment Share on other sites More sharing options...
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