To launch my .chm Help file for my Help Contents menu in windows. I’m trying to get the file to open and launch located in my program files location. This should be real easy code but everything I tried from the Xojo Documentation on FolderItems is not working. I know it’s got to be just a couple lines of code. What am I missing here. Can anyone help? Thx
Dim f As FolderItem
f = GetFolderItem(“C\Program Files\MyProgram\Help.chm”)
By default, GetFolderItem looks in the current directory, which would be where your program is. Also, on a 64-bit system, your program would be installed in “Program Files (64)”, not “Program Files”.
Hi guys, thank you for the fast response. I’m having my setup factory installer put the help file in a folder called Docs. Norman had mentioned path style for the full & absolute path. Would that be as below’s code example.
Dim f As FolderItem
f = GetFolderItem(“C:\Program Files\MyProgram\Docs\Help.chm”, FolderItem.PathTypeAbsolute)
I tried that code with no luck but I think it’s on the right track. Does Windows automatically open the app that displays the help, like the mouse click event does when I click on it. Do I have to tell it in code (Like mouse click event) to find the program from the extension .chm to execute the Help Display Program and open the help file in it.
If f.exists Then
// Open .chm program and display help file
End If
Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" (hwnd as Integer, url as CString, command as Integer, data as integer) as Integer
if HTMLHelp(0, f.AbsolutePath, 0, 0)= 0 then return false
Thanks Guys for all your help. It worked perfect after I installed it with the installer with the code below. I decided to put the help file in the main program folder instead of a Docs folder inside it, to make it easier.
Dim f As FolderItem
f = GetFolderItem(“GAS.chm”)
If f.Exists Then
f.Launch
Else
MsgBox(“The FolderItem does not exist.”)
End If