[DllImport("user32.dll")]
static extern bool WinHelp(IntPtr hWndMain, string lpszHelp, uint uCommand,
uint dwData);
<DllImport("user32.dll", SetLastError:=True, Charset:=Charset.Ansi)> _
Public Function bool WinHelp(hWndMain As IntPtr, _
<MarshalAs(UnmanagedType.LPStr)>lpszHelp As String, _
uCommand As UInteger, _
dwData As UInteger) As <MarshalAs(UnmanagedType.Bool)> Boolean
End function
[Enum.WinHelpCommands]
Here are the constants defined in Winver.h:
// Commands to pass to WinHelp()
const uint HELP_CONTEXT = 0x0001; /* Display topic in ulTopic */
const uint HELP_QUIT = 0x0002; /* Terminate help */
const uint HELP_INDEX = 0x0003; /* Display index */
const uint HELP_CONTENTS = 0x0003;
const uint HELP_HELPONHELP = 0x0004; /* Display help on using help */
const uint HELP_SETINDEX = 0x0005; /* Set current Index for multi index help */
const uint HELP_SETCONTENTS = 0x0005;
const uint HELP_CONTEXTPOPUP = 0x0008;
const uint HELP_FORCEFILE = 0x0009;
const uint HELP_KEY = 0x0101; /* Display topic for keyword in offabData */
const uint HELP_COMMAND = 0x0102;
const uint HELP_PARTIALKEY = 0x0105;
const uint HELP_MULTIKEY = 0x0201;
const uint HELP_SETWINPOS = 0x0203;
const uint HELP_CONTEXTMENU = 0x000a;
const uint HELP_FINDER = 0x000b;
const uint HELP_WM_HELP = 0x000c;
const uint HELP_SETPOPUP_POS = 0x000d;
const uint HELP_TCARD = 0x8000;
const uint HELP_TCARD_DATA = 0x0010;
const uint HELP_TCARD_OTHER_CALLER = 0x0011;
const uint IDH_NO_HELP = 28440;
const uint IDH_MISSING_CONTEXT = 28441; // Control doesn't have matching help context
const uint IDH_GENERIC_HELP_BUTTON = 28442; // Property sheet help button
const uint IDH_OK = 28443;
const uint IDH_CANCEL = 28444;
const uint IDH_HELP = 28445;
Please add some!
[DllImport("user32.dll")]
static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport("user32.dll")]
static extern bool WinHelp(IntPtr hWndMain, string lpszHelp, uint uCommand, uint dwData);
const uint YOUR_CONTEXT_SENSITIVE_HELP_ID = 32862;
string lpszClass = "WindowsForms10.Window.8.app3";
string lpszWindow = "Your Window Title";
IntPtr ParentHWnd = new IntPtr(0);
ParentHWnd = FindWindow(lpszClass, lpszWindow);
if (!ParentHWnd.Equals(IntPtr.Zero))
{
bool ret = WinHelp(ParentHWnd, "Your help file.hlp", HELP_CONTEXT, YOUR_CONTEXT_SENSITIVE_HELP_ID);
}
Do you know one? Please contribute it!