tags:

views:

61

answers:

2

Basically, I have two applications that run sequentially (second is started by the first, and the first exits immediately after.) I'd like to pass ownership of a window the first application created to the second application. The actual contents of the window don't need to be passed along, it's just being drawn in by DirectX.

Alternatively, but less desirably, is it possible to at least disable the window closing/opening animation, so it at least looks like the desired effect is achieved?

(This is in C, using the vanilla Win32 API.)

+2  A: 

Instead of separated application make a DLL that will be loaded by the first application and run within it.

adf88
@adf88: I may be missing something here, but how does this help?
torak
The first application loads the dll and runs code from it. No need to exit the application, and you can reuse resources (like windows).
Adam Shiemke
Ordinarily this answer would work fine, but for the project in question I actually don't have the source code for the second application. I planned on implementing the desired behavior in a hook. If you know of a way to load a regular executable file as a module, that might work though. (I suspect this would be incredibly difficult, though.)
ramsey
In this case there is nothing worth to do until there is some support from the second application.
adf88
+1  A: 

I suspect that you're going to run into problems because the WindowProc function is located in the memory address space of the program that you're closing.

Also, a quick look at the second remark at the bottom of the documentation for RegisterClass doesn't seem to offer up much hope.

The only work around that I can suggest for what you've described is to not close the first application until the second application is finished with the window in question.

torak