FUNCTION Show_HTMLHelp(inhwnd AS LONG,inHelpfile AS STRING) AS LONG
Show_HTMLHelp = HtmlHelp(inhwnd, inHelpfile, HH_DISPLAY_TOC, 0)
END FUNCTION
FUNCTION Show_HTMLHelp_ConTextID(inhwnd AS LONG,inHelpfile AS STRING,inContext AS LONG) AS LONG
Show_HTMLHelp_ConTextID = HtmlHelp(inhwnd, inHelpfile, HH_HELP_CONTEXT, inContext)
END FUNCTION
FUNCTION Show_HTMLHelp_Index(inhwnd AS LONG, inHelpfile AS STRING, inKeyword AS STRING) AS LONG
DEFSTR TheFullURL = inHelpfile + "::/" + inKeyword + ".html"
Show_HTMLHelp_Index = htmlHelpString(inhwnd, inHelpfile, HH_DISPLAY_TOPIC, 0)
DEFSTR s = inKeyword
DEFSTR Lnk = inKeyword + ".html"
DIM hlpLink AS HH_AKLINK
hlpLink.cbStruct = SIZEOF(hlpLink)
hlpLink.fReserved = False
hlpLink.pszKeywords = VARPTR(s)
hlpLink.pszUrl = VARPTR(Lnk)
hlpLink.pszMsgText = 0
hlpLink.pszMsgTitle = 0
hlpLink.pszWindow = 0
hlpLink.fIndexOnFail = True
HtmlHelp(GetDesktopWindow(), inHelpfile, HH_KEYWORD_LOOKUP, UDTPTR(hlpLink))
END FUNCTION
FUNCTION Show_HTMLHelp_Search(inhwnd AS LONG, inHelpfile AS STRING, inKeyword AS STRING) AS LONG
DIM HHQuery AS HH_FTS_QUERY
MEMSET(UDTPTR(HHQuery), 0, SIZEOF(HHQuery))
HHQuery.cbStruct = SIZEOF(HHQuery)
HHQuery.fUniCodeStrings = False
HHQuery.iProximity = -1
HHQuery.fStemmedSearch = False
HHQuery.fTitleOnly = False
HHQuery.fExecute = True
HHQuery.pszWindow = 0
DEFLNG hHH, hHHChild, hHHButton, hHHEdit
DEFSTR Token = inKeyword + CHR$(0)
HHQuery.pszSearchQuery = VARPTR(Token)
HHQuery.pszWindow = GetDesktopWindow()
hHH = HtmlHelp(GetDesktopWindow(), inHelpfile, HH_DISPLAY_SEARCH, HHQuery)
IF hHH THEN
hHHChild = GetChildHandle(hHH , "HH Child" , 2)
IF hHHChild THEN
hHHButton = GetChildHandle(hHHChild , "Button" , 1)
hHHEdit = GetChildHandle(hHHChild , "Edit" , 1)
IF hHHEdit AND hHHButton THEN
SetWindowText(hHHEdit , Token)
SendMessage(hHHEdit , WM_KEYUP , 0 , 0)
SendMessage(hHHButton , BM_CLICK , 0 , 0)
END IF
END IF
END IF
RESULT = hHH
END FUNCTION
SUB Close_HTMLHelp()
HtmlHelp 0, CHR$(0), HH_CLOSE_ALL, 0
END SUB
SUB Show_File(inHelpfile AS STRING)
DIM tmpFilePath AS STRING
DIM tmpFileName AS STRING
ShellExecute GetDesktopWindow(), "", StripFileName(inHelpFile), "", StripPath(inHelpFile), SW_NORMAL
END SUB
SUB HelpOnTopicClick
DEFSTR TheHelpFname = IDE.CompilerHelpFile
IF IDE.ModuleType(MFE_Tab.TabIndex) > 0 THEN TheHelpFname = IDE.FBCompilerHelpFile
IF re.SelText <> "" THEN
Show_HTMLHelp_Index(GetDesktopWindow(), TheHelpFname, re.SelText)
ELSE
DIM guida AS STRING
guida = IDE_GetKeywordFromText(re.WordAtCursor(), ")(" + Quot$)
Show_HTMLHelp_Index(GetDesktopWindow(), TheHelpFname, guida)
END IF
END SUB
SUB HelpSearchCHMOnTopicClick
DEFSTR TheHelpFname = IDE.CompilerHelpFile
IF IDE.ModuleType(MFE_Tab.TabIndex) > 0 THEN TheHelpFname = IDE.FBCompilerHelpFile
IF re.SelText <> "" THEN
Show_HTMLHelp_Search(GetDesktopWindow(), TheHelpFname, re.SelText)
ELSE
DIM guida AS STRING
guida = IDE_GetKeywordFromText(re.WordAtCursor(), ")(" + Quot$)
Show_HTMLHelp_Search(GetDesktopWindow(), TheHelpFname, guida)
END IF
END SUB
SUB mnuHelpClick
MainHelpClick(ContentHelpMenu.Handle)
END SUB
SUB mnuHelp2Click
MainHelpClick(Content2Menu.Handle)
END SUB
SUB mnuHelpWinClick
MainHelpClick(WinHelpMenu.Handle)
END SUB
SUB MainHelpClick(theHnd AS INTEGER)
DEFSTR TheHelpFname = IDE.CompilerHelpFile
IF IDE.ModuleType(MFE_Tab.TabIndex) > 0 THEN TheHelpFname = IDE.FBCompilerHelpFile
SELECT CASE theHnd
CASE ContentHelpMenu.Handle
RUN "rundll32.exe url.dll,FileProtocolHandler " + TheHelpFname
CASE Content2Menu.Handle
RUN "rundll32.exe url.dll,FileProtocolHandler " + STRIPPATH(TheHelpFname) + "\examples.hlp"
CASE ContentTopicHelpMenu.Handle
HelpOnTopicClick
CASE WinHelpMenu.Handle
RUN "rundll32.exe url.dll, FileProtocolHandler " + Quot$ + STRIPPATH(IDE.CompilerHelpFile) + "\win32_2.hlp" + Quot$
CASE REpopupHelpWord.Handle
Show_HTMLHelp_Index(GetDesktopWindow(), TheHelpFname, (REpopupHelpWord.CAPTION - "Help with "))
CASE ELSE
SHOWMESSAGE "internal help error"
END SELECT
END SUB
SUB IDE_SearchWeb4Word(inText AS STRING)
DEFSTR s = IDE.SearchEngine + inText
ShellExecute(0, "open", s, "", "", 1)
s = ""
END SUB
|
|