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. How can i query application start ?

How can i query application start ?

Scheduled Pinned Locked Moved C / C++ / MFC
questiondatabase
7 Posts 4 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.
  • D Offline
    D Offline
    Developer611
    wrote on last edited by
    #1

    Hello there , I want to get handle of specific application before start ,but i don't know how can i get that message and process it . in fact , i don't know exactly which message , i must be process . Thank you .

    DMASTER

    H 1 Reply Last reply
    0
    • D Developer611

      Hello there , I want to get handle of specific application before start ,but i don't know how can i get that message and process it . in fact , i don't know exactly which message , i must be process . Thank you .

      DMASTER

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      I think for get a handle to a program you need to run it.

      D 1 Reply Last reply
      0
      • H Hamid Taebi

        I think for get a handle to a program you need to run it.

        D Offline
        D Offline
        Developer611
        wrote on last edited by
        #3

        Dear Hamid, thanks to your reply. But, my question is that, when ever the user runs an application, how can i make a notification of that process start, in my own application. In fact, i want to query the process-start! I wonder if any system message (or any other method) exists, when an application starts?!

        DMASTER

        H 1 Reply Last reply
        0
        • D Developer611

          Dear Hamid, thanks to your reply. But, my question is that, when ever the user runs an application, how can i make a notification of that process start, in my own application. In fact, i want to query the process-start! I wonder if any system message (or any other method) exists, when an application starts?!

          DMASTER

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          If you know name of program you can use of FindWindow but if you dont know name of program you can use of EnumDesktopWindows for Enumerates all windows or EnumWindows for enumerates all windows on the screen that it gives you a handle to each window.

          D 1 Reply Last reply
          0
          • H Hamid Taebi

            If you know name of program you can use of FindWindow but if you dont know name of program you can use of EnumDesktopWindows for Enumerates all windows or EnumWindows for enumerates all windows on the screen that it gives you a handle to each window.

            D Offline
            D Offline
            Developer611
            wrote on last edited by
            #5

            I know these functions and their usage! but as you know, I should use them AFTER the process is already ran, and (for example) i should use them on the click of a button! the problem is that, my application should be aware of the process start, AS SOON AS THE PROCESS STARTS, and do its job automatically. I'm looking for a method, to make my application aware of the start event FOR ALL THE APPLICATIONS, not just an specific one. Something like a system message (WM_*), which is sent to ALL the applications (including mine) to notify them of a process start.

            DMASTER

            L M 2 Replies Last reply
            0
            • D Developer611

              I know these functions and their usage! but as you know, I should use them AFTER the process is already ran, and (for example) i should use them on the click of a button! the problem is that, my application should be aware of the process start, AS SOON AS THE PROCESS STARTS, and do its job automatically. I'm looking for a method, to make my application aware of the start event FOR ALL THE APPLICATIONS, not just an specific one. Something like a system message (WM_*), which is sent to ALL the applications (including mine) to notify them of a process start.

              DMASTER

              L Offline
              L Offline
              Lim Bio Liong
              wrote on last edited by
              #6

              Hello Developer611, Sounds like you need SetWindowsHookEx() with WH_CBT. Look it up in MSDN. It may help you. - Bio.

              1 Reply Last reply
              0
              • D Developer611

                I know these functions and their usage! but as you know, I should use them AFTER the process is already ran, and (for example) i should use them on the click of a button! the problem is that, my application should be aware of the process start, AS SOON AS THE PROCESS STARTS, and do its job automatically. I'm looking for a method, to make my application aware of the start event FOR ALL THE APPLICATIONS, not just an specific one. Something like a system message (WM_*), which is sent to ALL the applications (including mine) to notify them of a process start.

                DMASTER

                M Offline
                M Offline
                Mark Salsbery
                wrote on last edited by
                #7

                You could monitor WMI for an event of the Win32_ProcessStartTrace Class[^]. Example: Receiving Event Notifications Through WMI[^] Code Project: Making WMI Queries In C++[^] Mark

                Mark Salsbery Microsoft MVP - Visual C++ :java:

                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