No announcement yet.

WinHelp instances

  • Filter
  • Time
  • Show
Clear All
new posts

  • WinHelp instances

    I've observed that with programs that have Winhelp (as opposed to HTML) style help, there is only ever one instance of the help. For example, from app #1 display a help topic. Now display a help topic from app #2, PBEdit for example. The same window that was displaying app #1 help is now displaying PB help. Click the back button and we again see app #1 help but in a PB style window (ie. with the Contents/Index/Search window on the left). I've noticed similar behaviour with so many pairs of apps. that I conclude it's an inherent feature of Winhelp.

    That's sort of fair enough, I suppose, but the thing that seems a bit naff to me is that its possible to be viewing the help for one app and to then close the other app and the whole help comes down with it.

    Standalone help, on the other hand, seems to be multi instanced. For example, double click on PbDll.hlp, then double click again on PbDll.hlp and there are two instances of the help.

    Has anyone got any insight into the single instance behaviour of program help? Is there a way of making it multi instanced to prevent interaction with other progs?



  • #2
    Usually one uses the WinHelp API to show the help file. In order for
    Winhelp to not start a new instance for each call, it uses the hWnd
    parameter to separate which app's are calling it and if same program
    calls again, it doesn't load new file, but instead shows desired context.

    Without that, the whole desktop would be cluttered with helpfiles after
    a while, so it is good behaviour, IMHO. There are ways around this though.
    Think one can open up the help file by using a SHELL command instead. That
    way, WinHelp won't know who asked for help and start a new instance each time.
    Not shure how to set proper context that way, but should be possible with help
    of a switch, somehow.. I think..

    And, the reason why help files are closed automatically, is because MS
    recommends us to use WinHelp with HELP_QUIT on exit, so WinHelp knows
    this instance is no longer needed and can be closed. Can be ignored in
    own app's, if one doesn't agree with MS..



    • #3
      Thanks Borje. I think that's made it a bit clearer for me.

      Actually, the automatic closing of help was no mystery as I'm already calling WinHelp with %HELP_QUIT in my own app. As I said, it's the fact that closing one app. can have the side effect, from the users point of view, of also closing help of an app. he is continuing to use.

      Certainly, the SHELL command could give multi-instance help. As I'm very near completing my app. though, I'll stick with straight WinHelp calls. I suspect few if any users will notice the problem. I get a bit carried away with aesthetics sometimes.

      Many thanks.