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