From: Mayayana on
| > Look up the QueryUnload event. By calling
| > Unload Me there you're running a loop.
|
| Actually, it doesn't start a loop; "Unload Me" is not needed because the
| form is already unloading but it is apparently ignored
|

Interesting. You're right. I figured it would
result in at least one more QueryUnload event,
and that that might be why she was getting
an error report. I don't see why the
"Qualification Report" would be complaining
then. She even explicitly set cancel to False/0.
Maybe there's more to the code than what was
posted.

| > If unloadmode <> 0 then Exit sub
|
| of course, that means it won't ask to save if the form is closing for any
| other reason so that may not be what is wanted.
|

I suppose one could ask to save if Windows is
quitting.

| and I'd definitely use the constants there rather than the numeric values
|

Suit yourself. :)


From: Nobody on
"Sarah M. Weinberger" <nospam_mweinberger(a)hotmail.com> wrote in message
news:DB8CD7CB-677C-4256-B947-894920BFD711(a)microsoft.com...
> Hi,
>
> How does one adhere in VB6 to Restart Manager messages. Here is some text
> that Microsoft provides in the WinQual tests for Win7. Would that be the
> Form_QueryUnload? If so, am I to just return False there or what is
> Microsoft expecting?
>
> Thanks,
>
> Sarah
>
> --------------------------------------------------------------------------------------------------------------------------------------------------
> Some applications as part of their first launch display EULAs or auto
> update prompts, registration forms, etc. If your application performs in
> this way, it could be falsely reported as non-compliant with the restart
> requirement.
>
> If any of the above files are reported for this reason, you should restart
> testing from a clean state (clean OS). This time around, before running
> the /postinstall phase, execute any run-once functionality in the
> application PRIOR to running the /postinstall phase of the toolkit.
>
> IMPACT IF NOT FIXED: By failing to shutdown gracefully, customers could
> lose data when the OS finally forces a shutdown. It also slows the
> shutdown/reboot process, impacting performance perceptions.
>
> HOW TO FIX: In a critical shutdown, applications that return FALSE to
> WM_QUERYENDSESSION will be sent WM_ENDSESSION and closed, while those that
> time out in response to WM_QUERYENDSESSION, will be terminated. By
> following these guidelines, you can ensure that your application will
> handle critical shutdowns gracefully:
>
> WM_QUERYENDSESSION with LPARAM = ENDSESSION_CLOSEAPP(0x1): GUI 19
> applications must respond (TRUE) immediately in preparation for a restart
>
> WM_ENDSESSION with LPARAM = ENDSESSION_CLOSEAPP(0x1): Applications must
> return a 0 value within 30 seconds and shut down. At a minimum,
> applications should prepare by saving any user data and state information
> that is needed after a restart
>
> Console applications that receive CTRL_C_EVENT notification should shut
> down immediately. Drivers must not veto a system shutdown event
>
> More information and guidance on requesting and responding to system
> shutdowns and the RestartManager is available HERE
> --------------------------------------------------------------------------------------------------------------------------------------------------

After reading the document above, you need to subclass the form and
intercept WM_QUERYENDSESSION, and check LPARAM value for ENDSESSION_CLOSEAPP
or ENDSESSION_CRITICAL, and if so return +1(TRUE constant in the Windows
API). You should not prompt to save when you see this flag, just do what you
think is best(To save or not to save).

WM_QUERYENDSESSION Message:
http://msdn.microsoft.com/en-us/library/aa376890(VS.85).aspx


From: Mayayana on

|
| Questions:
|
| 1. Is there an easier way to test the shutdown without having to go
through
| the lengthly windows 7 qualification test?
|
| 2. Do all VB6 based applications suffer from this warning?
|
| 3. Thoughts on getting rid of the warning?
|

I thought someone might have given you a
definitive answer by now, but that hasn't happened.
Maybe you should try posting your actual code.
If your EXE is not properly responding to a system
message to close then you must be doing something to
keep it open. Returning 1 in QueryUnload or Unload?
Adding some kind of reference that keeps the program
running?


From: Karl E. Peterson on
Nobody wrote :
> "Sarah M. Weinberger" <nospam_mweinberger(a)hotmail.com> wrote in message
> news:DB8CD7CB-677C-4256-B947-894920BFD711(a)microsoft.com...
>> Hi,
>>
>> How does one adhere in VB6 to Restart Manager messages. Here is some text
>> that Microsoft provides in the WinQual tests for Win7. Would that be the
>> Form_QueryUnload? If so, am I to just return False there or what is
>> Microsoft expecting?
>>
>> Thanks,
>>
>> Sarah
>>
>> --------------------------------------------------------------------------------------------------------------------------------------------------
>> Some applications as part of their first launch display EULAs or auto
>> update prompts, registration forms, etc. If your application performs in
>> this way, it could be falsely reported as non-compliant with the restart
>> requirement.
>>
>> If any of the above files are reported for this reason, you should restart
>> testing from a clean state (clean OS). This time around, before running the
>> /postinstall phase, execute any run-once functionality in the application
>> PRIOR to running the /postinstall phase of the toolkit.
>>
>> IMPACT IF NOT FIXED: By failing to shutdown gracefully, customers could
>> lose data when the OS finally forces a shutdown. It also slows the
>> shutdown/reboot process, impacting performance perceptions.
>>
>> HOW TO FIX: In a critical shutdown, applications that return FALSE to
>> WM_QUERYENDSESSION will be sent WM_ENDSESSION and closed, while those that
>> time out in response to WM_QUERYENDSESSION, will be terminated. By
>> following these guidelines, you can ensure that your application will
>> handle critical shutdowns gracefully:
>>
>> WM_QUERYENDSESSION with LPARAM = ENDSESSION_CLOSEAPP(0x1): GUI 19
>> applications must respond (TRUE) immediately in preparation for a restart
>>
>> WM_ENDSESSION with LPARAM = ENDSESSION_CLOSEAPP(0x1): Applications must
>> return a 0 value within 30 seconds and shut down. At a minimum,
>> applications should prepare by saving any user data and state information
>> that is needed after a restart
>>
>> Console applications that receive CTRL_C_EVENT notification should shut
>> down immediately. Drivers must not veto a system shutdown event
>>
>> More information and guidance on requesting and responding to system
>> shutdowns and the RestartManager is available HERE
>> --------------------------------------------------------------------------------------------------------------------------------------------------
>
> After reading the document above, you need to subclass the form and intercept
> WM_QUERYENDSESSION, and check LPARAM value for ENDSESSION_CLOSEAPP or
> ENDSESSION_CRITICAL, and if so return +1(TRUE constant in the Windows API).
> You should not prompt to save when you see this flag, just do what you think
> is best(To save or not to save).
>
> WM_QUERYENDSESSION Message:
> http://msdn.microsoft.com/en-us/library/aa376890(VS.85).aspx

I agree with this assessment. And closing forms may only be a partial
solution, depending on the overall architecture.

OP: See http://vb.mvps.org/samples/SysInfo for a working sample
designed (in part) to provide you the notification to do as Nobody
suggests.

--
..NET: It's About Trust!
http://vfred.mvps.org