home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4705 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  2.1 KB

  1. Path: sparky!uunet!lax.pe-nelson.com!lax!twbrown
  2. From: twbrown@PE-Nelson.COM (Tom W. Brown)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: Getting rid of Help Engine on WM_SYSCOMMAND ?!
  5. Message-ID: <731@lax.lax.pe-nelson.com>
  6. Date: 7 Jan 93 20:11:25 GMT
  7. References: <1993Jan7.162242.7587@tandem.com>
  8. Sender: news@lax.pe-nelson.com
  9. Organization: PE-Nelson
  10. Lines: 34
  11.  
  12. In article <1993Jan7.162242.7587@tandem.com>, stu@Tandem.COM (Stuart Phillips) writes:
  13. |> I have an application with associated help.  When the user exits
  14. |> the application via the File|Exit command, I call WinHelp() with
  15. |> HELP_QUIT in order to cause the help engine to close its window
  16. |> and exit.  This works just fine.
  17. |> 
  18. |> However, if the use exits via the close menu item on the windows
  19. |> system menu, I can't get rid of the darn help engine!
  20. |> 
  21. |> I've tried processing the WM_SYSCOMMAND message and looking for
  22. |> the SC_CLOSE event; I process it just fine, call WinHelp() with
  23. |> HELP_QUIT but the help engine stays around!
  24.  
  25. A system menu close will end up sending you a WM_CLOSE message.  This is 
  26. the message you should be handling for cleanup of your application and 
  27. closing the help engine.
  28.  
  29. I usually implement my "Exit" command by simply posting a WM_CLOSE
  30. message to myself.  I've not noticed any problem with the help engine with
  31. this approach, it goes away whether I close from the system menu or from
  32. my exit command.
  33.  
  34. However, calling WinHelp(...HELP_QUIT...) at any time should be enough
  35. to close the help engine.  I can't think why it should matter whether
  36. you call this in response to the WM_SYSCOMMAND/SC_CLOSE or the WM_CLOSE
  37. message (I suppose it may depend on what, exactly, you are doing in
  38. response to the WM_SYSCOMMAND message).
  39.  
  40.  
  41. ----------------------------------------------------------------------------
  42. Tom Brown               |  "She turned me into a newt...
  43. PE Nelson Systems       |                                  ... I got better"
  44. twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
  45. ----------------------------------------------------------------------------
  46.