PureBasic Forum
http://forums.purebasic.com/english/

Offline MSDN/WIN32 reference
http://forums.purebasic.com/english/viewtopic.php?f=12&t=73129
Page 1 of 1

Author:  Rinzwind [ Fri Jul 05, 2019 7:51 am ]
Post subject:  Offline MSDN/WIN32 reference

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.

Author:  Bitblazer [ Fri Jul 05, 2019 10:40 am ]
Post subject:  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 ;)

Author:  chi [ Fri Jul 05, 2019 11:38 am ]
Post subject:  Re: Offline MSDN/WIN32 reference

Create your own IDE Tool... https://www.purebasic.fr/english/viewtopic.php?p=535561#p535561

Author:  Zebuddi123 [ Fri Jul 05, 2019 12:16 pm ]
Post subject:  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. :)

Author:  Rinzwind [ Sun Jul 07, 2019 6:04 am ]
Post subject:  Re: Offline MSDN/WIN32 reference

slight modification of code
Code:
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, word.s, hWnd_chm

Select CountProgramParameters()
  Case 2
    chm = ProgramParameter(0)
    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, "#")
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


ps. Somehow GetEnvironmentVariable("PB_TOOL_Word") always returns empty, so at the moment that variable is useless? Anyway, compile to exe, add tool with exe path and arguments "C:\Tools\MSDN\mini.chm" %WORD and shortcut of your choice.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/