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. manipulating windows / changing checkmarks, sliders

manipulating windows / changing checkmarks, sliders

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

    I don't really know exactly what this is called, so that may be why i haven't found any good information about it.. From one of my programs (a VC6.0 dialog based MFC application) i want to be able to check checkboxes, slide sliders etc of other MFC dialog based applications. Im not sure if its possible, but i would guess that it is since other programs can like hide windows and stuff. Is there a nifty way to do so in c++? (except for cheapy ways like moving the mouse and clicking by code) Like CheckBox(SomeWindow, SomeName, 1); :P (i know it can't be that easy, but in general..) Anybody have any experince with this, know what it might be called or have any urls? Since i dont have anything to work with right now i am open to any information :) thanks

    //Johannes

    Richard Andrew x64R P N J 4 Replies Last reply
    0
    • J Johpoke

      I don't really know exactly what this is called, so that may be why i haven't found any good information about it.. From one of my programs (a VC6.0 dialog based MFC application) i want to be able to check checkboxes, slide sliders etc of other MFC dialog based applications. Im not sure if its possible, but i would guess that it is since other programs can like hide windows and stuff. Is there a nifty way to do so in c++? (except for cheapy ways like moving the mouse and clicking by code) Like CheckBox(SomeWindow, SomeName, 1); :P (i know it can't be that easy, but in general..) Anybody have any experince with this, know what it might be called or have any urls? Since i dont have anything to work with right now i am open to any information :) thanks

      //Johannes

      Richard Andrew x64R Offline
      Richard Andrew x64R Offline
      Richard Andrew x64
      wrote on last edited by
      #2

      Such a thing is possible if you first obtain the window handle of the checkbox, slider, etc., and then use SendMessage() to send window messages to it. The hardest thing about this is determining the exact window to which you want to send the messages. Keep in mind that in Vista, your manipulator app has to have high enough "integrity" to send messages to other processes.

      -------------------------------- "All that is necessary for the forces of evil to win in the world is for enough good men to do nothing" -- Edmund Burke

      1 Reply Last reply
      0
      • J Johpoke

        I don't really know exactly what this is called, so that may be why i haven't found any good information about it.. From one of my programs (a VC6.0 dialog based MFC application) i want to be able to check checkboxes, slide sliders etc of other MFC dialog based applications. Im not sure if its possible, but i would guess that it is since other programs can like hide windows and stuff. Is there a nifty way to do so in c++? (except for cheapy ways like moving the mouse and clicking by code) Like CheckBox(SomeWindow, SomeName, 1); :P (i know it can't be that easy, but in general..) Anybody have any experince with this, know what it might be called or have any urls? Since i dont have anything to work with right now i am open to any information :) thanks

        //Johannes

        P Offline
        P Offline
        Perspx
        wrote on last edited by
        #3

        You could use the EnumWindows() API to search for all of the windows that are open, then when you have found the right window, you could use the FindWindowEx() API to find the right child window owned by the window returned by EnumWindows(). Then, as said above, you could use the SendMessage API to send the designated message to the window. Hope this helps! --PerpspX

        1 Reply Last reply
        0
        • J Johpoke

          I don't really know exactly what this is called, so that may be why i haven't found any good information about it.. From one of my programs (a VC6.0 dialog based MFC application) i want to be able to check checkboxes, slide sliders etc of other MFC dialog based applications. Im not sure if its possible, but i would guess that it is since other programs can like hide windows and stuff. Is there a nifty way to do so in c++? (except for cheapy ways like moving the mouse and clicking by code) Like CheckBox(SomeWindow, SomeName, 1); :P (i know it can't be that easy, but in general..) Anybody have any experince with this, know what it might be called or have any urls? Since i dont have anything to work with right now i am open to any information :) thanks

          //Johannes

          N Offline
          N Offline
          Naveen
          wrote on last edited by
          #4

          in addition to what Perspx said, you can use GetDlgItem() or EnumChildWindows() to get each controls in a dialog and then use GetClassName() to find which control it is.

          nave

          1 Reply Last reply
          0
          • J Johpoke

            I don't really know exactly what this is called, so that may be why i haven't found any good information about it.. From one of my programs (a VC6.0 dialog based MFC application) i want to be able to check checkboxes, slide sliders etc of other MFC dialog based applications. Im not sure if its possible, but i would guess that it is since other programs can like hide windows and stuff. Is there a nifty way to do so in c++? (except for cheapy ways like moving the mouse and clicking by code) Like CheckBox(SomeWindow, SomeName, 1); :P (i know it can't be that easy, but in general..) Anybody have any experince with this, know what it might be called or have any urls? Since i dont have anything to work with right now i am open to any information :) thanks

            //Johannes

            J Offline
            J Offline
            Johpoke
            wrote on last edited by
            #5

            Thanks for the help :D So im looking at the SendMessage, FindWindow and FindWindowEx, but im having trouble connecting them all, I declare a HWND to "hold the window". FindWindow("Control", 0); //Makes it so my program has control to the window called "Control" ? Then i have to use FindWindowEx to set which dialog radio buttons /checkboxes should be set and to what then SendMessage() to set it? Might you know how i would connect these? Or is the some nice tutorial somewhere :/ thanks :)

            //Johannes

            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