Results 1 to 6 of 6

Thread: [RESOLVED] How to force another program into my own

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2006
    Location
    In my head
    Posts
    913

    Resolved [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!!

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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".

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2006
    Location
    In my head
    Posts
    913

    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!!

  5. #5
    Hyperactive Member BrendanDavis's Avatar
    Join Date
    Oct 2006
    Location
    Florida
    Posts
    492

    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...

  6. #6
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width