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. Controlling other applications?

Controlling other applications?

Scheduled Pinned Locked Moved C / C++ / MFC
question
11 Posts 6 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.
  • L Lord Kixdemp

    Hello everyone! Is there a way to mess with other application's controls? I need to capture input from a text box from a specific program. Thanks in advance!

    Windows Calculator told me I will die at 28. :(

    Steve EcholsS Offline
    Steve EcholsS Offline
    Steve Echols
    wrote on last edited by
    #2

    Yes, it's called subclassing. Basically you can steal any messages from the other window, modify it it, eat it, pass it on, or do whatever you want with it. Been awhile since I've done it, but you can replace an existing windows WndProc with your own, using SetWindowLong and GWL_WNDPROC. There are a ton of articles on CP, but can't seem to locate the one I was thinking of... [edit] Look at CWnd::SubclassWindow or CWindowImpl::SubclassWindow if using ATL/WTL. [/edit]


    - S 50 cups of coffee and you know it's on!

    • S
      50 cups of coffee and you know it's on!
      Code, follow, or get out of the way.
    1 Reply Last reply
    0
    • L Lord Kixdemp

      Hello everyone! Is there a way to mess with other application's controls? I need to capture input from a text box from a specific program. Thanks in advance!

      Windows Calculator told me I will die at 28. :(

      N Offline
      N Offline
      nbugalia
      wrote on last edited by
      #3

      You can also use hooking to do the same. Search for PasswordSpy by Brian Friese in codeproject for an example.

      1 Reply Last reply
      0
      • L Lord Kixdemp

        Hello everyone! Is there a way to mess with other application's controls? I need to capture input from a text box from a specific program. Thanks in advance!

        Windows Calculator told me I will die at 28. :(

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #4

        Lord Kixdemp wrote:

        Is there a way to mess with other application's controls? I need to capture input from a text box from a specific program.

        WM_GETTEXT and WM_GETTEXTLENGTh will help!, and for reteriving Window Handle of particular Control! use FindWindow Api

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
        Never mind - my own stupidity is the source of every "problem" - Mixture

        cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

        R L 2 Replies Last reply
        0
        • L Lord Kixdemp

          Hello everyone! Is there a way to mess with other application's controls? I need to capture input from a text box from a specific program. Thanks in advance!

          Windows Calculator told me I will die at 28. :(

          T Offline
          T Offline
          ThatsAlok
          wrote on last edited by
          #5

          Lord Kixdemp wrote:

          Windows Calculator told me I will die at 28.

          how to calculate that??

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
          Never mind - my own stupidity is the source of every "problem" - Mixture

          cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

          L 1 Reply Last reply
          0
          • T ThatsAlok

            Lord Kixdemp wrote:

            Is there a way to mess with other application's controls? I need to capture input from a text box from a specific program.

            WM_GETTEXT and WM_GETTEXTLENGTh will help!, and for reteriving Window Handle of particular Control! use FindWindow Api

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
            Never mind - my own stupidity is the source of every "problem" - Mixture

            cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

            R Offline
            R Offline
            Rajesh R Subramanian
            wrote on last edited by
            #6

            Long time no see! Been busy with work? :)


            Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->ßRÅhmmÃ<-·´¯`·.

            T 1 Reply Last reply
            0
            • R Rajesh R Subramanian

              Long time no see! Been busy with work? :)


              Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->ßRÅhmmÃ<-·´¯`·.

              T Offline
              T Offline
              ThatsAlok
              wrote on last edited by
              #7

              brahmma wrote:

              Long time no see! Been busy with work?

              Changed my job. so busy learning new stuff!

              "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
              Never mind - my own stupidity is the source of every "problem" - Mixture

              cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

              1 Reply Last reply
              0
              • T ThatsAlok

                Lord Kixdemp wrote:

                Is there a way to mess with other application's controls? I need to capture input from a text box from a specific program.

                WM_GETTEXT and WM_GETTEXTLENGTh will help!, and for reteriving Window Handle of particular Control! use FindWindow Api

                "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
                Never mind - my own stupidity is the source of every "problem" - Mixture

                cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

                L Offline
                L Offline
                Lord Kixdemp
                wrote on last edited by
                #8

                Hmm... Well, thanks all for your suggestions! :) However, I doubt any of these work on Internet Explorer controls... And how would I get the window text if it always changes depending on the page being viewed? Please don't think I'm teh skr1pt k1dd1e, I need this for something else. ;P Thanks!

                Windows Calculator told me I will die at 28. :(

                1 Reply Last reply
                0
                • T ThatsAlok

                  Lord Kixdemp wrote:

                  Windows Calculator told me I will die at 28.

                  how to calculate that??

                  "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
                  Never mind - my own stupidity is the source of every "problem" - Mixture

                  cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

                  L Offline
                  L Offline
                  Lord Kixdemp
                  wrote on last edited by
                  #9

                  Since everyone keeps asking this, I'll answer it. :laugh: Year of birth - 1337: convert to hex: remove letters 1989 - 1337 = 652: 28C: 28

                  Windows Calculator told me I will die at 28. :(

                  M 1 Reply Last reply
                  0
                  • L Lord Kixdemp

                    Since everyone keeps asking this, I'll answer it. :laugh: Year of birth - 1337: convert to hex: remove letters 1989 - 1337 = 652: 28C: 28

                    Windows Calculator told me I will die at 28. :(

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

                    Lord Kixdemp wrote:

                    Year of birth - 1337: convert to hex: remove letters 1989 - 1337 = 652: 28C: 28

                    :omg:

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

                    L 1 Reply Last reply
                    0
                    • M Mark Salsbery

                      Lord Kixdemp wrote:

                      Year of birth - 1337: convert to hex: remove letters 1989 - 1337 = 652: 28C: 28

                      :omg:

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

                      L Offline
                      L Offline
                      Lord Kixdemp
                      wrote on last edited by
                      #11

                      I am such a skilled mathematician. :-D

                      Windows Calculator told me I will die at 28. :(

                      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