Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Text popups in HtmlHelp
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00256881
Message ID:
00256999
Vues:
25
>Dear All
>
>I have a nice WinHelp API function that raises text popups nicely:
>
>**********************************
>PROCEDURE ContextHelp
>LPARAMETER ContextID
>LOCAL HWND
>
>#DEFINE HELP_CONTEXTPOPUP 8
>#
>DECLARE INTEGER WinHelp IN USER32 INTEGER, STRING, INTEGER, INTEGER
>DECLARE INTEGER GetActiveWindow IN USER32
>
>* parameters FOR WinHelp from WIN32API.HLP
>* HWND hwnd, // handle of window requesting Help
>* LPCTSTR lpszHelp, // address of directory-path string
>* UINT uCommand, // type of Help
>* DWORD dwData // additional data
>
>HWND = GetActiveWindow()
>= WinHelp(HWND, "POPUP.HLP", HELP_CONTEXTPOPUP, ContextID)
>CLEAR DLLS
>ENDPROC
>**********************************
>
>But I'm using HtmlHelp now. I cannot get a rewrite, or any of the alternatives, to work in HtmLHelp. For example:
>
>**********************************
>PROCEDURE ContextHelp
>LPARAMETER nContextID
>LOCAL hWnd
>
>#DEFINE HH_DISPLAY_TEXT_POPUP 14
>
>DECLARE INTEGER HtmlHelp IN HHCTRL.OCX INTEGER, STRING, INTEGER, INTEGER
>DECLARE INTEGER GetActiveWindow IN USER32

The problem is that the data type of the final parameter is not a fixed data type; in fact, the MSDN help topic specifically warns that it is a variable data type, and warns that you'll get a GPF if the data type is incorrect (see the topic Displaying Help by Using the HtmlHelp API iin the MSDN docs; it's part of the Microsoft Office 2000/Visual Basic Programmer's Guide, and can be accesssed from msdn.micxrosft.com if you don't have an MSDN subscription.

I'm not certain what the correct data type is here for the declaration in conjuction with the action you've requested. the two values in the immediately referenced docs at HH_DISPLAY_TOPIC (0) and HH_HELP_CONTEXT (15, or 0x0F).

Since you need the HTML object IAC, you might want to use the ActiveX control rather than trying to get at the API directly; VFP communicates with the automation object without the ambiguities of the API entering the situation.

The complete documentation can be accessed at http://msdn.microsoft.com/workshop/author/htmlhelp/default.asp; the full docs are at http://msdn.microsoft.com/workshop/author/htmlhelp/refov.asp

>
>hWnd = GetActiveWindow()
>= HtmlHelp(hWnd, "POPUP.CHM", HH_DISPLAY_TEXT_POPUP, nContextID)
>CLEAR DLLS
>ENDPROC
>**********************************
>
>This brings up the right help file but causes an instant GPF. I don't even know if it is syntactically correctly to declare 'HtmlHelp IN HHCTRL.OCX'. Also, HHCTRL.OCX doesn't behave like a normal ActiveX that can be put in a class library.
>
>Another way, where 2001 is mapped to a .topic in a file specified in the [TEXT POPUPS] section in HtmlHelp workshop:
>
>**********************************
>THIS.WhatsThisHelpID = 2001
>THIS.ShowWhatsThis
>**********************************
>
>This raises "HH_HELP_CONTEXT called without [MAP] section Error".
>See: http://206.86.100.18:8080/fvisualbasicexplorerhtmlhelp
>for a lot of other people who can't figure out how to crack this one.
>
>I have wasted a fair amount of time with no success. Any ideas?
>John Burton
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform