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. Help Needed Controlling other application using VC++

Help Needed Controlling other application using VC++

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialquestion
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.
  • R Offline
    R Offline
    Ram Murali
    wrote on last edited by
    #1

    Hi All, I am using a software to run a occupancy report manually by clicking a button in the software. I would like to automate this task by writing MFC application to programatically click the button every hour. So I dont know how to activate other application's button by my program. Could anyone please suggest me some possible solution for this? I am not sure where to start and how to proceed. Any piece of information will help me a lot. Thanks in advance.

    Regards, Ram

    L K 2 Replies Last reply
    0
    • R Ram Murali

      Hi All, I am using a software to run a occupancy report manually by clicking a button in the software. I would like to automate this task by writing MFC application to programatically click the button every hour. So I dont know how to activate other application's button by my program. Could anyone please suggest me some possible solution for this? I am not sure where to start and how to proceed. Any piece of information will help me a lot. Thanks in advance.

      Regards, Ram

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Ram Murali wrote:

      So I dont know how to activate other application's button by my program.

      Why not just use a timer in the main application so it sleeps for an hour and then runs its activities? Alternatively you could probably use the Windows Task Scheduler.

      R D 2 Replies Last reply
      0
      • L Lost User

        Ram Murali wrote:

        So I dont know how to activate other application's button by my program.

        Why not just use a timer in the main application so it sleeps for an hour and then runs its activities? Alternatively you could probably use the Windows Task Scheduler.

        R Offline
        R Offline
        Ram Murali
        wrote on last edited by
        #3

        Hi Thanx for your reply. Timer function wise, i have no problem. But my problem is how to activate other application's button using my own program. I used FindWindow() method to get the other application's window handle. But How to get the control of the button to send message to that button? This is the biggest issue to me now.

        Regards, Ram

        L 1 Reply Last reply
        0
        • R Ram Murali

          Hi Thanx for your reply. Timer function wise, i have no problem. But my problem is how to activate other application's button using my own program. I used FindWindow() method to get the other application's window handle. But How to get the control of the button to send message to that button? This is the biggest issue to me now.

          Regards, Ram

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Ram Murali wrote:

          But How to get the control of the button to send message to that button?

          I think you need to enumerate all the child windows until you find the button, then post a message to the button's HWND. However this seems a very complicated way of going about solving what is really a simple timer issue.

          R 1 Reply Last reply
          0
          • L Lost User

            Ram Murali wrote:

            But How to get the control of the button to send message to that button?

            I think you need to enumerate all the child windows until you find the button, then post a message to the button's HWND. However this seems a very complicated way of going about solving what is really a simple timer issue.

            R Offline
            R Offline
            Ram Murali
            wrote on last edited by
            #5

            Can you please tell me the easiest way to do this? Thanks

            Regards, Ram

            1 Reply Last reply
            0
            • R Ram Murali

              Hi All, I am using a software to run a occupancy report manually by clicking a button in the software. I would like to automate this task by writing MFC application to programatically click the button every hour. So I dont know how to activate other application's button by my program. Could anyone please suggest me some possible solution for this? I am not sure where to start and how to proceed. Any piece of information will help me a lot. Thanks in advance.

              Regards, Ram

              K Offline
              K Offline
              Kushagra Tiwari
              wrote on last edited by
              #6

              Use FindWindow() and then EnumChildWindows() to find that button .Refer MSDN for both functions.That will surely help u. Mark this ans as good if u feel it helped. Kushagra

              1 Reply Last reply
              0
              • L Lost User

                Ram Murali wrote:

                So I dont know how to activate other application's button by my program.

                Why not just use a timer in the main application so it sleeps for an hour and then runs its activities? Alternatively you could probably use the Windows Task Scheduler.

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                Richard MacCutchan wrote:

                Why not just use a timer in the main application so it sleeps for an hour and then runs its activities?

                I think it's a 3rd-party application that he's wanting to run and simulate a button click within.

                "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

                "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                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