[RESOLVED] How to force another program into my own
I am trying to create a program that will allow me to cram one or more instances/programs into a multi frame window. So basically...theoretically I could have 4 portions and open excel, word, AIM and Firefox....or any other program(s) I so choose.
I have thought over this considerably and the only thing I can come up with is get the handle of the window the program opens up in (is it always the same??) and then force that to redirect into my program....Anybody point me in the right direction? I am not even sure what this is called and even more confused about what to search for on the internet or the forums.
Thanks!!
Re: How to force another program into my own
You can use hte SetParent API but to do what you want for multiple third part programs may produce some unwanted effects for one or all programs "forced" as they are not designed to be child applications housed under a single parent program. ;)
Re: How to force another program into my own
SetParent requires you to pass the handle of the window in question which you can get using FindWindow. FindWindow works well when passed the Window caption. Is the Window caption always the same?
Having said that, RobDog888 brings up a very good point about the possibility of running into "unexpected features" when attempting to "force" an application to be a "child".
Re: How to force another program into my own
Thanks for the replies I will work on that and let you know if I run into trouble. Oh and yes, the caption is always the same. I will also see if I can put a detect change on the caption that way I can hopefully be proactive on errors.
Thanks again!!
Re: [RESOLVED] How to force another program into my own
Hehe, I did this a while ago as a way of freeing up space in my taskbar when I had multiple apps open at the same time. I called it "WinManage" ;D
P.S. You WILL get errors should you have 2 applications that wish to show a window modally at the same time. At least I did, anyway. Beware of that...
Re: [RESOLVED] How to force another program into my own
An example you can look at that I ran into a long time ago can be found in the below link:
http://www.codeproject.com/vb/net/ByPassAutomation.asp