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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. A question about window service....

A question about window service....

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
7 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.
  • S Offline
    S Offline
    sunyw_2006
    wrote on last edited by
    #1

    Hello. everyone I want to change a exe application to a window service. The application(exe) can receive some self-defined messages from other exe, so I want to receive same messages in the service too. Please teach me how to realize it? Thanks. -Freehawk

    L K 2 Replies Last reply
    0
    • S sunyw_2006

      Hello. everyone I want to change a exe application to a window service. The application(exe) can receive some self-defined messages from other exe, so I want to receive same messages in the service too. Please teach me how to realize it? Thanks. -Freehawk

      L Offline
      L Offline
      Laxman Auti
      wrote on last edited by
      #2

      sunyw_2006 wrote:

      I want to change a exe application to a window servic

      See the Service(.exe) option of the ATL com Project. Knock out 't' from can't, You can if you think you can :cool:

      1 Reply Last reply
      0
      • S sunyw_2006

        Hello. everyone I want to change a exe application to a window service. The application(exe) can receive some self-defined messages from other exe, so I want to receive same messages in the service too. Please teach me how to realize it? Thanks. -Freehawk

        K Offline
        K Offline
        kakan
        wrote on last edited by
        #3

        Check this article: http://www.codeproject.com/system/xyntservice.asp[^]

        S 1 Reply Last reply
        0
        • K kakan

          Check this article: http://www.codeproject.com/system/xyntservice.asp[^]

          S Offline
          S Offline
          sunyw_2006
          wrote on last edited by
          #4

          Thanks for reply. In "xyntservice.asp" sample, it can not receive messages from other exe. I need to handle some messages from other exe. -Freehawk.

          K 1 Reply Last reply
          0
          • S sunyw_2006

            Thanks for reply. In "xyntservice.asp" sample, it can not receive messages from other exe. I need to handle some messages from other exe. -Freehawk.

            K Offline
            K Offline
            kakan
            wrote on last edited by
            #5

            As far as I know, xyntservice can execute Win32 GUI apps (who has got a message pump). So it wouldn't be a problem for you. Check out the ini-file sample (that starts up Notepad). If Notepad can be started under xyntservice, so will your app. And if Notepad will receive Windows messages, so will your app. Try it out!

            S 1 Reply Last reply
            0
            • K kakan

              As far as I know, xyntservice can execute Win32 GUI apps (who has got a message pump). So it wouldn't be a problem for you. Check out the ini-file sample (that starts up Notepad). If Notepad can be started under xyntservice, so will your app. And if Notepad will receive Windows messages, so will your app. Try it out!

              S Offline
              S Offline
              sunyw_2006
              wrote on last edited by
              #6

              Thanks. But when the current user log off, the exe is quited. 1.During logged off, can the window service call the exe? 2.Can the window service receive "log off" message? -Freehawk

              K 1 Reply Last reply
              0
              • S sunyw_2006

                Thanks. But when the current user log off, the exe is quited. 1.During logged off, can the window service call the exe? 2.Can the window service receive "log off" message? -Freehawk

                K Offline
                K Offline
                kakan
                wrote on last edited by
                #7

                sunyw_2006 wrote:

                1.During logged off, can the window service call the exe? 2.Can the window service receive "log off" message?

                1. Nope. A service can of course not send messages to a terminated app. 2. Check out WM_ENDSESSION. MSDN: [^]

                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