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. Events in hidden dialogs (and services)

Events in hidden dialogs (and services)

Scheduled Pinned Locked Moved C / C++ / MFC
help
4 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.
  • M Offline
    M Offline
    mmica
    wrote on last edited by
    #1

    I have written a sample application to catch the WM_DEVICECHANGE message and it works well. Now I tried to move the same functionality into a service so I create the service and the service creates an instance of a class which I defined that extends CDialog (called CMessageHandler). CMessageHandler m_MessageHandler; m_MessageHandler.Create(HIDDEN_DIALOG, NULL); {This returns TRUE, I checked} CMessageHandler is supposed to handle WM_DEVICECHANGE event but it doesn't. I have declared it in the message map and I have created the necessary OnDEviceChange function but the messages never seem to be caught. I'm sure I'm doing something really stupid here. Any help would be greatly appreciated.

    L R 2 Replies Last reply
    0
    • M mmica

      I have written a sample application to catch the WM_DEVICECHANGE message and it works well. Now I tried to move the same functionality into a service so I create the service and the service creates an instance of a class which I defined that extends CDialog (called CMessageHandler). CMessageHandler m_MessageHandler; m_MessageHandler.Create(HIDDEN_DIALOG, NULL); {This returns TRUE, I checked} CMessageHandler is supposed to handle WM_DEVICECHANGE event but it doesn't. I have declared it in the message map and I have created the necessary OnDEviceChange function but the messages never seem to be caught. I'm sure I'm doing something really stupid here. Any help would be greatly appreciated.

      L Offline
      L Offline
      l a u r e n
      wrote on last edited by
      #2

      have u checked the service actually receives messages?


      "there is no spoon"
      biz stuff   about me

      M 1 Reply Last reply
      0
      • L l a u r e n

        have u checked the service actually receives messages?


        "there is no spoon"
        biz stuff   about me

        M Offline
        M Offline
        mmica
        wrote on last edited by
        #3

        I had posted a question in this forum earlier and was told that a service could receive messages indirectly if I created a window to handle the messages. Would a window normally start receiving messages after the Create() method is called or should it be visible in order for it to receive messages? Am I creating it right? Thanks for your help :-)

        1 Reply Last reply
        0
        • M mmica

          I have written a sample application to catch the WM_DEVICECHANGE message and it works well. Now I tried to move the same functionality into a service so I create the service and the service creates an instance of a class which I defined that extends CDialog (called CMessageHandler). CMessageHandler m_MessageHandler; m_MessageHandler.Create(HIDDEN_DIALOG, NULL); {This returns TRUE, I checked} CMessageHandler is supposed to handle WM_DEVICECHANGE event but it doesn't. I have declared it in the message map and I have created the necessary OnDEviceChange function but the messages never seem to be caught. I'm sure I'm doing something really stupid here. Any help would be greatly appreciated.

          R Offline
          R Offline
          ray_dyo
          wrote on last edited by
          #4

          Hello there. I have read a message that you posted in this forum that u have written a sample application to catch the WM_DEVICECHANGE message and it works well. I was wondering if you could e-mail to me a sample of the above application as I am interested in implementing that same function. Also, would you happen to know of any working samples/examples that have implemented the OnDeviceChange() function? If you do, it would be great if you could lead me to/send me those sources. I hope u can help. RaYDyO

          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