Jeremy White wrote:
Do you think it's worth adding the ShowHelpContext function to the core of Win32-GUI so that there is no dependency on Win32::OLE? The code is relatively straightforward:

http://search.cpan.org/src/JDB/libwin32-0.24/OLE/OLE.xs

I'd prefer to investigate and support the WinHelp() function from user32.dll - It's the documented way to do this using the Win32 API. I will admit to never having used this call.

The API looks like this:

BOOL WinHelp(
    HWND hWndMain,
    LPCTSTR lpszHelp,
    UINT uCommand,
    ULONG_PTR dwData
);

For the equivalent of what you were doing:
lpszHelp is a pointer the the path to the help file
uCommand is HELP_CONTEXT
dwData is the context identifier

Much more is possible :-) See MSDN.

Regards,
Rob.


void
_ShowHelpContext(helpfile,context)
   char *helpfile
   IV context
PPCODE:
{
   HWND hwnd;
   dPERINTERP;

   if (!g_hHHCTRL) {
    g_hHHCTRL = LoadLibrary("HHCTRL.OCX");
    if (g_hHHCTRL)
g_pfnHtmlHelp = (FNHTMLHELP*)GetProcAddress(g_hHHCTRL, "HtmlHelpA");
   }

   if (!g_pfnHtmlHelp) {
    warn(MY_VERSION ": HtmlHelp control unavailable");
    XSRETURN_EMPTY;
   }

   // HH_HELP_CONTEXT 0x0F: display mapped numeric value in dwData
hwnd = g_pfnHtmlHelp(GetDesktopWindow(), helpfile, 0x0f, (DWORD)context);

   if (hwnd == 0 && context == 0) // try HH_DISPLAY_TOPIC 0x0
    g_pfnHtmlHelp(GetDesktopWindow(), helpfile, 0, (DWORD)context);
}


Cheers,

jez.




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/


Reply via email to