Article View: comp.os.ms-windows.programmer.misc
Article #2564Re: Getting rid of Help Engine on WM_SYSCOMMAND ?!
From: Tom W. Brown
Date: Thu, 07 Jan 1993 20:11
Date: Thu, 07 Jan 1993 20:11
34 lines
2158 bytes
2158 bytes
In article <1993Jan7.162242.7587@tandem.com>, stu@Tandem.COM (Stuart Phillips) writes: |> I have an application with associated help. When the user exits |> the application via the File|Exit command, I call WinHelp() with |> HELP_QUIT in order to cause the help engine to close its window |> and exit. This works just fine. |> |> However, if the use exits via the close menu item on the windows |> system menu, I can't get rid of the darn help engine! |> |> I've tried processing the WM_SYSCOMMAND message and looking for |> the SC_CLOSE event; I process it just fine, call WinHelp() with |> HELP_QUIT but the help engine stays around! A system menu close will end up sending you a WM_CLOSE message. This is the message you should be handling for cleanup of your application and closing the help engine. I usually implement my "Exit" command by simply posting a WM_CLOSE message to myself. I've not noticed any problem with the help engine with this approach, it goes away whether I close from the system menu or from my exit command. However, calling WinHelp(...HELP_QUIT...) at any time should be enough to close the help engine. I can't think why it should matter whether you call this in response to the WM_SYSCOMMAND/SC_CLOSE or the WM_CLOSE message (I suppose it may depend on what, exactly, you are doing in response to the WM_SYSCOMMAND message). ---------------------------------------------------------------------------- Tom Brown | "She turned me into a newt... PE Nelson Systems | ... I got better" twbrown@pe-nelson.com | Monty Python and the Holy Grail ----------------------------------------------------------------------------
Technical Details
Message-ID:
<731@lax.lax.pe-nelson.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrownReferences:
<1993Jan7.162242.7587@tandem.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrown From: twbrown@PE-Nelson.COM (Tom W. Brown) Newsgroups: comp.os.ms-windows.programmer.misc Subject: Re: Getting rid of Help Engine on WM_SYSCOMMAND ?! Message-ID: <731@lax.lax.pe-nelson.com> Date: 7 Jan 93 20:11:25 GMT References: <1993Jan7.162242.7587@tandem.com> Sender: news@lax.pe-nelson.com Organization: PE-Nelson Lines: 34