State Power Button

  • Thread starter Thread starter Michel REYDET
  • Start date Start date
M

Michel REYDET

Hi Slobodan,

I use the MinLogon componant.
My specific sofware must read the state of power button.

How read this state ?

In don't want shutdown or hibernate my target. I want use the power button
like input state.

Regards.
 
The code describe here :

case WM_POWERBROADCAST:

if(wParam==PBT_APMSUSPEND) ExitWindowsEx(EWX_POWEROFF | EWX_FORCEIFHUNG,
SHTDN_REASON_MAJOR_APPLICATION | SHTDN_REASON_MINOR_MAINTENANCE);

break;

in the newsgroup, to intercept the change of state SUSPENDS and to shutdown
Windows, whereas it is enough to parameter Windows to make SHUTDOWN rather
than SUSPENDS.

Windows does not transmit a message informing that the power button was
push. Message WM_POWERBROADCAST is not transmitted.... thus not
intercepted...


Regards.

"Slobodan Brcin (eMVP)" <sbrcin@
ptt.yu> wrote in message news:uJ%[email protected]...
Hi Michel,

I have no idea what MS did to new minlogon (I do not use it). But with old
minlogon you can use message WM_POWERBROADCAST in your
 
You will have to include ACPI support in your image, and also "support" for Power Buttons.

If this does not help, you will have to follow chain of events from remote kernel debugger like in thread I had in kernel ng.

Also make sure that there is no application present that intercept this event like explorer, possibly new minlogon QFE, or perhaps
something else.

Regards,
Slobodan
 
what about QUERYENDSESSION ?

micha

Slobodan Brcin (eMVP) said:
You will have to include ACPI support in your image, and also "support" for Power Buttons.

If this does not help, you will have to follow chain of events from remote
kernel debugger like in thread I had in kernel ng.
Also make sure that there is no application present that intercept this
event like explorer, possibly new minlogon QFE, or perhaps
 
WM_QUERYENDSESSION? It will never be called (unless your device is responding to power button, in this case someone already handled
POWER message)

BTW: What happens on your device when you press power button?
Please note that I have no idea how WM_POWERBROADCAST will behave on new minlogon QFE.

If you know how to use kernel debugger you can see if anything happens when you press power button.
Follow my conversation in kernel news group that will show you how to do this.

Regards,
Slobodan
 
Hi,
WM_QUERYENDSESSION? It will never be called (unless your device is responding to power button,
in this case someone already handled POWER message)

BTW: What happens on your device when you press power button?
Please note that I have no idea how WM_POWERBROADCAST will behave on new minlogon QFE.

Hmmm, what means "new"? We have XPe SP1 TD. Is this some hotfix or updated download?
If you know how to use kernel debugger you can see if anything happens when you press power button.
Follow my conversation in kernel news group that will show you how to do this.

microsoft.public.win32.programmer.kernel? Which thread or date, please?

Thanks,

Ulf
 
Back
Top