Creating a process that appears inside a window that I created??

This is a discussion on Creating a process that appears inside a window that I created?? within the Windows Programming forums, part of the Platform Specific Boards category; Hi, I am trying to make an application that will spawn two processes. My application will be an MFC application. ...

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    205

    Creating a process that appears inside a window that I created??

    Hi,
    I am trying to make an application that will spawn two processes. My application will be an MFC application. I will be using CreateProcess to make the two processors (calc & conf for example). My question is as follows:
    Is it possible to create the processes and make them appear inside the boundaries of my MFC window so that when I move my window the applications will move too. Thanks a lot
    Amish

  2. #2
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    The window is about the only part of your application that is "on the screen". You can have two processes running, and as long as they both have a handle to the same window, they can both add what they want to that window.

  3. #3
    Registered User
    Join Date
    Dec 2004
    Posts
    205
    Quote Originally Posted by sean_mackrory
    The window is about the only part of your application that is "on the screen". You can have two processes running, and as long as they both have a handle to the same window, they can both add what they want to that window.
    But how do I pass the handle to my main window down to the processes for them to use?
    Amish

  4. #4
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    No, it's not possible to do what you are trying to do.

  5. #5
    Registered User
    Join Date
    Dec 2004
    Posts
    205
    How about this:
    Can I have the created process (Which can be an application I made) scan for handles to currently open windows and then find the appropriate window handle and use that to become a child of that window.
    Amish

  6. #6
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    nope, sorry. Explain what it is you are trying to accomplish, and maybe I can come up with another way of doing it.

  7. #7
    Registered User
    Join Date
    Dec 2004
    Posts
    205
    I have a program A and B that were already coded using MFC by someone else. I need to make another program C that will spawn multiple copies of A and B and display them inside a window that program C creates. I don't want to change the code in program A and B r access their internal functions to realize that. I want to be able to use them as "modules". I hope it is clearer now. Thanks
    Amish

  8. #8
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,607
    Are you trying to simulate an MDI application by having multiple A and B instances "contained" within a master window?

    What type of control do you need to have over the A and B instances? Why does it have to be inside program C's window?

    It can probably be done, but it would take a lot of systems-level programming know-how.

    gg
    Last edited by Codeplug; 01-13-2005 at 07:43 PM. Reason: grammer...

  9. #9
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    To do what you want would require heavily modifying the source code to programs A and B. Since you say you dont want to do this, then I think you need to come up with another solution to your problem.

  10. #10
    Registered User
    Join Date
    Dec 2004
    Posts
    205
    I guess it will be like an MDI application. Ok let's say I will need to modify the code in the original programs. I have a solution with 3 projects in it. Is there a way to access the functions of 1 project A from the other projet B without having to include all the files from project A in the project B. I am using MSVS .NET 2003. Thanks
    Amish

  11. #11
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    You wouldnt have to include all the files, just the ones that relate to the functions you want to call.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C or C++
    By AcerN30 in forum Game Programming
    Replies: 41
    Last Post: 05-30-2008, 06:57 PM
  2. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 07:14 AM
  3. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  4. Adding buttons, edit boxes, etc to the window
    By rainmanddw in forum Windows Programming
    Replies: 1
    Last Post: 04-10-2006, 03:07 PM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21