SMH and Look 'n' Stop

Discussion in 'ProcessGuard' started by nameless, Nov 1, 2004.

Thread Status:
Not open for further replies.
  1. nameless

    nameless Registered Member

    Joined:
    Feb 23, 2003
    Posts:
    1,233
    This isn't a bug report, just a ... user confusion report, I guess.

    If I enable Secure Message Handling (SMH) for Look 'n' Stop (looknstop.exe), the following reproducible behavior occurs:

    If I hold down the Insert key while performing step 3, the behavior reverts to what I'd expect: Only one HCR dialog, not two. And when that one HCR dialog is cancelled, Look 'n' Stop does not exit.

    What confuses me is that PG seems to need to learn the WM_NCDESTROY event in order to handle SMH properly for Look 'n' Stop. But then why does the second HCR dialog appear at all? This sort of thing implies to me that you really need to be careful on testing SMH after enabling it.

    Software versions I am running:

    Windows XP Professional SP-2
    ProcessGuard 3.000
    Look 'n' Stop 2.05p2
     
  2. nameless

    nameless Registered Member

    Joined:
    Feb 23, 2003
    Posts:
    1,233
    Actually, after closing Look 'n' Stop a few times, PG has reverted to showing multiple HCR dialogs. The first one shown needs the correct characters typed in before LNS will be shut down, but the second and third HCR dialogs can be canceled, and LNS shuts down anyway. The Insert key doesn't change this behavior, as I thought it had before.

    Now I'm really confused.
     
  3. Jason_DiamondCS

    Jason_DiamondCS Former DCS Moderator

    Joined:
    Nov 11, 2002
    Posts:
    1,046
    Location:
    Perth, Western Australia
    Don't worry too much about this if you don't understand it, windows design is very confusing. :)

    Basically once a program wants to shutdown there is nothing you can do to stop it doing so short of suspending the process. So what ProcessGuard tries to do is to stop the program from shutting down by blocking the initial "message" to shutdown. Which is usually the user pressing the X button on the window or the File -> Exit menu, etc.

    So once one message gets through to the program that "the user wants to exit" and you click OK to the first prompt to allow it, the program will shutdown regardless of the future prompts you cancel on. I hope this is somewhat understable. :)

    In regards to the INSERT feature on the menu, all that does is tell ProcessGuard to learn to intercept that menu item before it gets sent to the program. In this case it is the EXIT menu item you tried it on.

    If that message gets to the program it will continue to shutdown regardless of anything you cancel, this is because as I said before the program is on a mission to shutdown and no programmer really "error" checks if a window is destroyed or not when shutting down. This isn't bad programming it is just the way things are done when shutting down your application. There is no point if you can't destroy a window for the application to go "well I'm not going to close now" and stay active in a half destroyed state.

    So just to recap, ProcessGuard needs to stop the initial shutdown message from getting to the application, it can do this in 99% of cases with a combination of using the INSERT feature on special menu items/buttons and it's default message handling. Once any "close/exit" message gets through to the application there is nothing that you can do to stop it. You will get prompts that windows are trying to Destroyed, etc, but it won't matter how you handle them once one exit message has been received.
     
  4. nameless

    nameless Registered Member

    Joined:
    Feb 23, 2003
    Posts:
    1,233
    So is there any way to get one and only one HCR dialog when closing Look 'n' Stop? (If the answer to this is imbedded above, I must not have enough caffeine in my system--or neurons firing--to detect it.)
     
  5. Jason_DiamondCS

    Jason_DiamondCS Former DCS Moderator

    Joined:
    Nov 11, 2002
    Posts:
    1,046
    Location:
    Perth, Western Australia
    Well simply click OK TO ALL and you will only get one on closing it. :)

    But apart from that there is no way to handle it in the way you desire if the program has multiple windows, etc.
     
  6. nameless

    nameless Registered Member

    Joined:
    Feb 23, 2003
    Posts:
    1,233
    OK, I can deal with that. I just like to hit the Enter key, rather than fumble for the mouse. May this be considered a feature request for a user-selectable option to make "OK to all" the default?

    Thanks, Jason.
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.