Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. WM_SHUTDOWN notification Win32 dll

WM_SHUTDOWN notification Win32 dll

Scheduled Pinned Locked Moved C / C++ / MFC
questiondesignhelp
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AssemblySoft
    wrote on last edited by
    #1

    Hi, I have a dll that runs as a process via dllHost. My problem is i need to know when a Windows Shutdown event is being fired. I've never had this problem before because all my apps have a main window and receive this notification. However the dll just keeps working and terminates in an undetermined state. I can't have the dll called from an app. I have no alternative but to use what i've got. how can i register to receive a WM_SHUTDOWN event from my dll? :wtf: Please don't suggest i change the design of the solution. I'm confined to what i have. thanks in advance Carl

    G B 2 Replies Last reply
    0
    • A AssemblySoft

      Hi, I have a dll that runs as a process via dllHost. My problem is i need to know when a Windows Shutdown event is being fired. I've never had this problem before because all my apps have a main window and receive this notification. However the dll just keeps working and terminates in an undetermined state. I can't have the dll called from an app. I have no alternative but to use what i've got. how can i register to receive a WM_SHUTDOWN event from my dll? :wtf: Please don't suggest i change the design of the solution. I'm confined to what i have. thanks in advance Carl

      G Offline
      G Offline
      geo_m
      wrote on last edited by
      #2

      What about a creating an invisible hidden window for just receiving this message (under W2K+ you can use message only windows designed specially for these purposes - see HWND_MESSAGE for details)

      A 1 Reply Last reply
      0
      • A AssemblySoft

        Hi, I have a dll that runs as a process via dllHost. My problem is i need to know when a Windows Shutdown event is being fired. I've never had this problem before because all my apps have a main window and receive this notification. However the dll just keeps working and terminates in an undetermined state. I can't have the dll called from an app. I have no alternative but to use what i've got. how can i register to receive a WM_SHUTDOWN event from my dll? :wtf: Please don't suggest i change the design of the solution. I'm confined to what i have. thanks in advance Carl

        B Offline
        B Offline
        BaldwinMartin
        wrote on last edited by
        #3

        Yes instead though create a custom message In both headers: #define MY_MESSAGE (WM_USER+22) Then trap it in defwinpro "Naked we come and bruised we go." - James Douglas Morrison Best Wishes, ez_way

        A 1 Reply Last reply
        0
        • B BaldwinMartin

          Yes instead though create a custom message In both headers: #define MY_MESSAGE (WM_USER+22) Then trap it in defwinpro "Naked we come and bruised we go." - James Douglas Morrison Best Wishes, ez_way

          A Offline
          A Offline
          AssemblySoft
          wrote on last edited by
          #4

          I only have one binary, the dll. Hence only one header. I am running the dll as an application, through another process.

          B 1 Reply Last reply
          0
          • G geo_m

            What about a creating an invisible hidden window for just receiving this message (under W2K+ you can use message only windows designed specially for these purposes - see HWND_MESSAGE for details)

            A Offline
            A Offline
            AssemblySoft
            wrote on last edited by
            #5

            thanks for the comment but firstly this needs to be a solution to all current windows platforms (excluding servers) and secondly i'm sure there must be a way to register for this event, even in a dll. hmmm Regards Carl

            1 Reply Last reply
            0
            • A AssemblySoft

              I only have one binary, the dll. Hence only one header. I am running the dll as an application, through another process.

              B Offline
              B Offline
              BaldwinMartin
              wrote on last edited by
              #6

              OK sorry, did your try force parm? BOOL x = ExitWindowsEx(EWX_FORCE,NULL); "Naked we come and bruised we go." - James Douglas Morrison Best Wishes, ez_way

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups