CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Win32 Messages

  1. #1
    Join Date
    Jan 2009
    Posts
    13

    Win32 Messages

    Hi everyone,

    How can i receive messages from windows in my windowless application? My app is a single process that runs in the backgorund and has no window. I need to receive a WTSRegisterSessionNotification with WM_WTSSESSION_CHANGE and also the WM_ENDSESSION message but I have no window (so no handle). How can it be achieved? There MUST be a way to do that without creating an unvisible window.

    Thanks in advance!

  2. #2
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: Win32 Messages

    WTSRegisterSessionNotification registers reception of session changes to a particular window. so indeed there MUST be a window. It strikes me somewhat odd you would even want to do this without a window.


    If you have a service (and typically no window) you would want to use RegisterServiceCtrlHandlerEx() instead and write your own service handler to do (more or less) the same.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured