in short:
i want to intercept suspend/standby messages on my laptop, but my program doesn't receives all relevant messages.
background:
there's a bug in ms-excel on windows xp/2k, which prevents system suspend if a file is opened on a network/usb drive.
i'm trying to work-around it programmatically (my toolbox include python, vb6, or command line tools).
i know nothing about windows instrumentation :-)
i have a sysinternals utility that suspends the system anyhow. i want to hook it to the close-lid event!
in long:
The notebook lid close (fujitsu u810) initiate the standby procedure [how?]
The system then send everybody WM_POWERBROADCAST: PBT_APMQUERYSUSPEND (i can trace them using SPYXX.EXE
)
Every program answers "True", until excel answers "false", and the whole process stops.
My questions:
1) my python program doesn't catch neither pbm_apmquerysuspend, nor PBT_APMQUERYSTANDBYFAILED, nor PBT_APMQUERYSUSPENDFAILED: ` ...
query = "SELECT * FROM Win32_PowerManagementEvent"
power_watcher = wmi.ExecNotificationQuery ( query )
power_event = power_watcher.NextEvent ()
` it receives only PBT_APMSUSPEND, if standby finally occurs.
Why not - and how do i intercept it?
2) Is there another way to intercept the standby process?
in a prefect world, i would set the lid-close event to run a command i choose. in a perfect world, lid-closure is a documented event.
thank you all :-)