Using WinBatch as a wrapper

Started by oradba4u, September 10, 2020, 10:59:33 PM

Previous topic - Next topic

oradba4u

All:
I want to run an exe file inside a re-sizable window using WinBatch as the wrapper. When I quit the running program, it also kills the wrapper.
Any ideas?

snowsnowsnow


JTaylor

Yes.   A little more detail would be helpful.   Is WinBatch making the resizable Window?   What is the EXE doing?    Not sure what interaction is supposed to be taking place.

Jim

ChuckC

There are ways to link the parent/child relationship between window handles across process boundaries when you have access to the source code and are developing 2 different programs to cooperate with each other.  However, even that doesn't result in embedding one window within another like you are describing.

What you're trying to do is to arbitrarily force a main window belonging to one process to become a child window of a MDI [Multiple Document Interface] main window owned by a WinBatch process.  Short of doing some very murky cross-process code-injection and having to deal with process security and possible differences in process elevation levels under UAC, it's a task that falls under the category of "significantly non-trivial", at best, when coding in a language like C++.  With WinBatch, I would consider the task to be significantly more difficult.

It would be advisable to re-think what it is that you're trying to accomplish and modify your requirements.  WinBatch can launch an arbitrary program as a child process and monitor for the termination of the child process.  WinBatch can also send messages to an application's window(s) to move them and resize them.  What it can't readily do is "contain" another application's windows(s) within an arbitrary window owned by the WinBatch process.


The following blog post may possibly help:

https://devblogs.microsoft.com/oldnewthing/20130412-00/?p=4683


oradba4u