Application.SetSuspendState and power event

cricrides

New member
Joined
Mar 4, 2009
Messages
4
Programming Experience
10+
Hello guys,

I need your help on the following subject:

I have an application that detects a power change (to standby or hibernate).
AddHandler SystemEvents.PowerModeChanged, AddressOf PowerChangeSub

When I hit the standby key on my keyboard, the power change is detected and all actions are done properly.

However, when I enter the standby mode by using:
Application.SetSuspendState(PowerState.Suspend, True, False)
The computer goes to stand by but the event of powermodechanged is NOT triggered.

Any idea how to overcome that problem?

Thanks a lot,

cricri
 
I think the answer lies in your force=True.
help said:
force
Type: System.Boolean

true to force the suspended mode immediately; false to cause Windows to send a suspend request to every application.
My impression is that this suspend request equals the application event notification.
 
Back
Top