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 to control the other app using Window API

How to control the other app using Window API

Scheduled Pinned Locked Moved C / C++ / MFC
c++jsontutorialquestion
5 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.
  • U Offline
    U Offline
    User 9123917
    wrote on last edited by
    #1

    May I know how can I take control of other app using my own program in vc++. Eg: do a "scroll up" in browser ; open MS Word and save; perform "next/previous" in window photo viewer.. etc

    D L 3 Replies Last reply
    0
    • U User 9123917

      May I know how can I take control of other app using my own program in vc++. Eg: do a "scroll up" in browser ; open MS Word and save; perform "next/previous" in window photo viewer.. etc

      D Offline
      D Offline
      dusty_dex
      wrote on last edited by
      #2

      There's either ShellExecute (to launch apps), or the more sophisticated method of using COM/COM+ automation. (formerly known as OLE) Adding-automation-to-MFC-applications www.cgoakley.org/prog/oleaut.html

      "It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan That's what machines are for. Got a problem? Sleep on it.

      U 1 Reply Last reply
      0
      • D dusty_dex

        There's either ShellExecute (to launch apps), or the more sophisticated method of using COM/COM+ automation. (formerly known as OLE) Adding-automation-to-MFC-applications www.cgoakley.org/prog/oleaut.html

        "It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan That's what machines are for. Got a problem? Sleep on it.

        U Offline
        U Offline
        User 9123917
        wrote on last edited by
        #3

        how about pressing a hotkey combination (eg: CTRL+S for save)?

        1 Reply Last reply
        0
        • U User 9123917

          May I know how can I take control of other app using my own program in vc++. Eg: do a "scroll up" in browser ; open MS Word and save; perform "next/previous" in window photo viewer.. etc

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

          Take a look at the SendInput function[^].

          Use the best guess

          1 Reply Last reply
          0
          • U User 9123917

            May I know how can I take control of other app using my own program in vc++. Eg: do a "scroll up" in browser ; open MS Word and save; perform "next/previous" in window photo viewer.. etc

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

            The classic way os to do a PostMessage() (Or SendMessage()) for which you need tohe window handle of the receiving app and thw WM_COMAND value of te controll you want to manipulate. You can also do some surprisingly nifty stuff with windows hooks (look at SetWindowsHookEx()) if you want total control of another app.

            ============================== Nothing to say.

            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