Useful to some:
http://phix.x10.mx/download.php
See paragraph about 'Optional help file'. A modern offline CHM help file distilled from the online MSDN pages. If only PB would allow to use this with F1... Fred? I mean that old win32.hlp thing is way past it's expiration date! And the link in the PB help to the SDK http://www.microsoft.com/msdownload/pla ... sdkupdate/ doesn't even work anymore.
The scripting language Phix (which is similar in use to OpenEuphoria) itself is also worth a look btw.
Offline MSDN/WIN32 reference
Re: Offline MSDN/WIN32 reference
Cool thanks. I will incorporate this into my own windows message debugging stuff for purebasic before releasing it. But first i have to check which one is more complete and if the licensing is compatible
Re: Offline MSDN/WIN32 reference
Create your own IDE Tool... viewtopic.php?p=535561#p535561
Et cetera is my worst enemy
- Zebuddi123
- Enthusiast
- Posts: 794
- Joined: Wed Feb 01, 2012 3:30 pm
- Location: Nottinghamshire UK
- Contact:
Re: Offline MSDN/WIN32 reference
Hi chi thanks for the link and both chi and ts-soft for the code
Ctrl + F1 Brill
Anyone wants win32.chm ---- https://sourceforge.net/projects/win32-help-chm/
Zebuddi.
Ctrl + F1 Brill
Anyone wants win32.chm ---- https://sourceforge.net/projects/win32-help-chm/
Zebuddi.
malleo, caput, bang. Ego, comprehendunt in tempore
Re: Offline MSDN/WIN32 reference
slight modification of code
ps. Somehow GetEnvironmentVariable("PB_TOOL_Word") always returns empty, so at the moment that variable is useless?
Anyway, compile to exe, add tool with commandline as exe's path and arguments "C:\Tools\MSDN\mini.chm" %WORD and shortcut of your choice (ALT+F1).
Online search:
Tools/configure Tools.../New/
Commandline:%path-to-whelp.exe%
Arguments:"https://duckduckgo.com/?q=! $WORD site:https://docs.microsoft.com/en-us/windows/win32/" %WORD
(example)
Shortcut: ALT+F2
Code: Select all
EnableExplicit
If CreateMutex_(0, 1, "MSDN.CHM") = 0 Or GetLastError_() <> 0
PostMessage_(FindWindow_(0,"MSDN"), #WM_CLOSE, 0, 0)
EndIf
Prototype HtmlHelp(a, b.s, c, d)
#HH_DISPLAY_TOC = 1
#HH_DISPLAY_TOPIC = $0
#HH_HELP_FINDER = $0
#HH_SET_WIN_TYPE = $4
#HH_GET_WIN_TYPE = $5
#HH_GET_WIN_HANDLE = $6
#HH_SYNC = $9
#HH_KEYWORD_LOOKUP = $D
#HH_DISPLAY_TEXT_POPUP = $E
#HH_HELP_CONTEXT = $F
#HH_TP_HELP_CONTEXTMENU = $10
#HH_TP_HELP_WM_HELP = $11
Structure HH_AKLINK
cbStruct.l
fReserved.l
pszKeywords.s
pszUrl.s
pszMsgText.s
pszMsgTitle.s
pszWindow.s
fIndexOnFail.l
EndStructure
Procedure HtmlHelp(HelpFile.s, Keyword.s) ;by ts-soft (https://www.purebasic.fr/english/viewtopic.php?p=355981#p355981)
Protected AKLIN.HH_AKLINK, HtmlHelp_.HtmlHelp, hWnd
Protected DLL = OpenLibrary(#PB_Any, "HHCtrl.ocx")
If DLL
HtmlHelp_ = GetFunction(DLL, "HtmlHelpW")
With AKLIN
\cbStruct = SizeOf(HH_AKLINK)
\fReserved = 0
\pszKeywords = Keyword
\fIndexOnFail = #True
EndWith
hWnd = HtmlHelp_(0, HelpFile, #HH_KEYWORD_LOOKUP, AKLIN)
;HtmlHelp_(0, HelpFile, #HH_DISPLAY_TOC, 0)
CloseLibrary(DLL)
ProcedureReturn hWnd
EndIf
EndProcedure
Define chm.s, http.s, word.s, hWnd_chm
Select CountProgramParameters()
Case 2
chm = ProgramParameter(0)
If FindString(chm, "http")
http = chm
chm = ""
EndIf
word = ProgramParameter(1)
Default
chm = GetPathPart(GetEnvironmentVariable("PB_TOOL_IDE")) + "Help\mini.chm"
word = ProgramParameter(0)
If word = ""
word = GetEnvironmentVariable("PB_TOOL_Word")
EndIf
EndSelect
word = RTrim(word, "_")
word = LTrim(word, "#")
If http <> ""
http = ReplaceString(http, "$WORD", word)
http = URLEncoder(http)
RunProgram(http)
Else
hWnd_chm = HtmlHelp(chm, word)
If hWnd_chm
;MessageRequester("Debug", chm + #CRLF$ + word, #PB_MessageRequester_Info)
While IsWindow_(hWnd_chm)
Delay(1000)
Wend
Else
MessageRequester("Help file not found", "Please copy mini.chm to a 'Help' folder in the PureBasic installation folder or specify help file location and keyword as program parameters." + #CRLF$ + #CRLF$ + chm + #CRLF$ + word, #PB_MessageRequester_Info)
EndIf
EndIf
Anyway, compile to exe, add tool with commandline as exe's path and arguments "C:\Tools\MSDN\mini.chm" %WORD and shortcut of your choice (ALT+F1).
Online search:
Tools/configure Tools.../New/
Commandline:%path-to-whelp.exe%
Arguments:"https://duckduckgo.com/?q=! $WORD site:https://docs.microsoft.com/en-us/windows/win32/" %WORD
(example)
Shortcut: ALT+F2
Last edited by Rinzwind on Thu Aug 27, 2020 5:40 am, edited 3 times in total.
Re: Offline MSDN/WIN32 reference
Small change: added online search to above post.
Re: Offline MSDN/WIN32 reference
PB_TOOL_Word usually doesn't recognize the word if the cursor is at the end of the word!Rinzwind wrote:ps. Somehow GetEnvironmentVariable("PB_TOOL_Word") always returns empty, so at the moment that variable is useless?
test| -> ""
tes|t -> "test"
Didn't test your code, though...
Et cetera is my worst enemy