Re: How to: distinguish ShutDown Message from Restart Message

From: Eric (bauersachs_at_kull.ch.nospam.me.com)
Date: 08/31/04


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



Relevant Pages

  • Computer humor
    ... The following are new Windows messages that are under consideration ... (Y/N) ... User Error: Intelligence Resource Level Insufficient ...
    (sci.med.transcription)
  • Re: Windows messages not delivered to COM service project.
    ... If you have created the window using CreateWindow in the WinMain ... the windows messages mysteriously get lost (i ... GetMessage function. ...
    (microsoft.public.vc.atl)
  • Re: User defined mesage in C#?
    ... those user defined windows messages. ... With a delegate, you can use Control.Invokeor Control.BeginInvokeand PostMessage, respectively) to have a method run on the GUI thread. ... Events don't in and of themselves address the cross-thread issue, and they still require the use of delegates. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: inter-process communication
    ... Callback function will get all the information to whoever is asking for it. ... We have a dll which makes/monitors system changes. ... would need to use a registered windows message with a unique string. ... If windows messages are not the way to go, ...
    (microsoft.public.vc.mfc)
  • How to: distinguish ShutDown Message from Restart Message
    ... I use Windows API ExitWindowEx to exit windows XP. ... distinguish them through Windows Message? ... so I can deny its logging in? ...
    (microsoft.public.win32.programmer.messaging)