I forgot to mention that if you want to start the external process in a suspended state, you can call CreateProcess() with a special flag called CREATE_SUSPENDED, and the process will be loaded, but will not run until you resume each of its threads.
I have to look into that. With Pause and Resume I noticed how much I could have used PROCESS_INFORMATION. I could have skipped thread list traverse with SuspendThread(pi.dwThreadId),if I am not mistaken
You know while I was investigating this I have thought about switching back to CreateProcess base on what I read. Before, I had gone back and forth between CreateProcess and ShellExecuteEx (at one point I had two launch functions). But ultimately I stuck with the one that allows me to use lpOperation, open associated program automatically and open url using default application. Also I was influence by An Introduction to Processes: Asynchronous Process Notification[^], where Microsoft recommend the use of ShellExecute.
Now if there is someway for CreateProcess to use lpOperation that would be nice. OR have ShellExecuteEx populate PROCESS_INFORMATION.
I always wonder why there isn't a function that encapsulate both strengths.
I'd like to use a transparent PNG image as the background of a top level window (WS_POPUP).
Using GDI+ I have the image displayed correctly, but the problem is the transparent area (eg what is under my window) is not refreshed when I move the window.
I have already tried to use the WS_EX_LAYERED style and the UpdateLayeredWindow function to get the image displayed and it works fine. But the problem is I want to add child controls to my window and with this approach they are not rendered.
Well, if you use layered windows you have to draw (and possible also handle) controls yourself. As far as i know there's no safe, reliable way to do what you want to do (i mean the way you are trying to do it). An alternative can be using Window regions[^], you can use these with windows displaying normal controls BUT this does not give you a nice look, it just lets you clip the window to some shape, but you can't nicely antialias the window for example. Another way would be combining a layered window and a non-layered window. The layered part would contain the transparent parts and the non-layered part would contain the controls, you would need to keep the Z-Order and visibility state synchrnoized between the two types of windows. It is probably a pain in the ass to implement correctly but it can be done.
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Sometimes you just have to hate coding to do it well. <
Just to clarify things up, here is what the window looks like: http://img52.imageshack.us/img52/3956/81503777.jpg
And here is what happens when I move the window over the desktop: http://img186.imageshack.us/img186/7079/96798366.jpg
What do you think would be the best way to display this kind of window (transparent background image + controls)?