Re: How to: distinguish ShutDown Message from Restart Message
From: Eric (bauersachs_at_kull.ch.nospam.me.com)
Date: 08/31/04
- Previous message: Eric: "Re: CDO and Virtual SMTP server"
- In reply to: Wang Qing: "How to: distinguish ShutDown Message from Restart Message"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 31 Aug 2004 07:55:18 +0200
Hello
First of all I think you are in the wrong newsgroup. Messaging is not meant
for Windows messages but instead for the messaging system as used for e-mail
etc.
Same is true for the guy up there asking about HWND_BROADCAST.
Someone else may correct me if I'm wrong.
Anyway, here is that what I know:
- ENDSESSION: I don't think there's a reason to distinguish them. In both
cases Windows will be shut down. Applications should behave exactly the same
if there is a shutdown or a restart. You should use the policies to
configure what a user can do. (I don't know much about policies though.)
- Logon: Windows controls who can log on. If you want to interfere with this
mechanism *before* someone logs in, you have to use the security system
somehow. You can't use windows messages for that.
Eric
"Wang Qing" <WangQing@discussions.microsoft.com> wrote in message
news:A899E180-AA66-412E-B6B8-DF4CB28FC159@microsoft.com...
> I meet a problem. I use Windows API ExitWindowEx to exit windows XP. Then
the
> Windows XP will send WM_QUERYENDSESSION and WM_ENDSESSION to all
> applications. But I write a program (application) to detect whether the XP
> wants to shutdown the system or restart the system. How can my application
> distinguish them through Windows Message?
>
> And the same problem exists suspending the system and hibernating the
system.
>
> The second problem is I can use API WTSRegisterSessionNotification and
then
> wait for WM_WTSSESSION_CHANGE (WTS_SESSION_LOGON) to know whether a user
is
> logging in. But does there exist a method to detect a user wants to log
in,
> so I can deny its logging in?
>
> If I use WTS_SESSION_LOGON, in fact it has logged in. So, I need a Windows
> Message to know the logging in before it logged in.
>
> Welcome any advice. Thanks.
>
> --
> --wang qing
- Previous message: Eric: "Re: CDO and Virtual SMTP server"
- In reply to: Wang Qing: "How to: distinguish ShutDown Message from Restart Message"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|