Question

I am not sure how to ask the question so here is a picture of some idea that came to mind

pic

So for example, when you run my "custom launcher" it displays a window with a couple buttons on the side which you can assign values to. When you click on a button, the appropriate program will run in the big panel on the right (in window mode).

This is all from the user's perspective of course. They will just see that the program they want to run appears in that panel. The actual implementation may have nothing to do with "one program running inside another program"

My own use case is limited to windows desktop platforms only, but if it is possible to generalize it that would be nice as well.

Is this actually possible? Can I write such a program that will run another program inside a panel? The program that's launched may be someone else's, such as MS paint or calculator.

Was it helpful?

Solution

Just to expand on my comment above, here is an approach that may work for you: Fake it :)

When you launch the program, intercept all windows messages to the program that control it's position on screen. That way it 'appears' to be fixed in place, but in reality it's still attached to the normal Windows desktop.

Here's some light reading for you:

Windows Event Hooks

A hook is a mechanism by which an application can intercept events, such as messages, mouse actions, and keystrokes. A function that intercepts a particular type of event is known as a hook procedure. A hook procedure can act on each event it receives, and then modify or discard the event.

OTHER TIPS

I would recommend against it in a commercial application because you are modifying the behavior of software you don't own - that software may make assumptions about what its parent window is, but for experimentation there's the SetParent Win32 function.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top