Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / WM_QUERYENDSESSION

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. WM_QUERYENDSESSION
#12145
Posted by: mestrini 2007-12-07 19:03:55 Last edited by: mestrini 2007-12-07 19:15:08 (Total edited 1 time)
I'm trying to catch the system shutdown messages in order to stop it, perform some action and the shut down by myself but i'm getting pretty much confused with WindowProc Function and all that is associated.
I believe that reginald is already doing it since it catches the WM_xxx messages sent to the script window. Any ideas on how to accomplish it?

tx

EDIT:
SORRY, i should have looked at the main script window events because it's already implemented...

please delete, tx
Message2.
#12146
Posted by: mestrini 2007-12-07 21:28:43
hmm, i can't seem to get it to work; system proceeds to Shut Down no matter what...

help says i should return an empty string to prevent WM_ENDSESSION to be started but i can't get it.

help please...
tx
Message3.
#12217
Posted by: mestrini 2008-01-08 23:23:49
Bump...

Any thoughts,examples Jeff... anyone?

tx
Message4. Sorry - not a sort of thing I'd want to experiment with
#12218
Posted by: Michael S 2008-01-09 01:24:24
what with my machine shutting down all the time as a result.
Message5.
#12223
Posted by: Jeff Glatt 2008-01-11 00:46:00
I've never used WM_QUERYENDSESSION, so I'm not sure how it works. Have you tried doing a
RETURN 0
... to see if that makes a difference?
Message6. Re:
#12224
Posted by: mestrini 2008-01-11 03:12:20
I've never used WM_QUERYENDSESSION, so I'm not sure how it works. Have you tried doing a
RETURN 0
... to see if that makes a difference?

Does just the same. Windows proceeds to shutdown/logoff  :(
Message7.
#12225
Posted by: Jeff Glatt 2008-01-11 05:55:51
Are you using Vista or XP? The behavior is different between those OS'es.

http://msdn2.microsoft.com/en-us/library/ms700677.aspx

Also, you are in fact getting the QUERYENDSESSION event? It has to be handled by your main window (which has no parent).
Message8.
#12226
Posted by: mestrini 2008-01-11 07:26:04
I'm running XP and my script has no child windows. In fact the main window is hidden and the user interacts with an icon resting on the systray.

I'm not getting the QUERYENDSESSION event at all.
Message9.
#12228
Posted by: Jeff Glatt 2008-01-11 10:24:53
Ah. That could be the problem then. The operating system sends the message only to the main window, and not a hidden one either.
Message10.
#12229
Posted by: mestrini 2008-01-11 17:32:59
Even showing the main window i get no event.
But shouldn't a hidden window get the system's message? It still has a handle that can catch signals, i think.

Maybe i'm doing it wrong. You think you can find time to scribble an example?

tx
Message11.
#12231
Posted by: mestrini 2008-01-12 02:53:20
Ok, the most i can achieve is a small delay in logging off and explorer.exe being forced by windows to close. Can it be that the script replies correctly to the OS but rxlaunch.exe proceeds to shutdown?
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥1,390.00 ·
 
 
¥810.00 ·
 
 
¥1,380.00 ·
 
 
¥908.00 ·
 
 
¥790.00 ·
 
 
¥918.00 ·
© Tue 2024-11-5  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0