Some games (for example Red Alert 2) uses a small stub to call main executable with special arguments and/or environment variables.
It will be nice to be able to hook child processes with same settings as launchers.
You need not hook both programs: hook just the son, and launch it from the father's interface. Isn't it working?
Yes it works.
but the game has a black bar on the top, and flickering.
I'll see.... If I remember correctly, the C&C series had a lot of problems because of a mixed usage of ddraw and GDI functions, and I never got rid of all of them.
I'll try again, hopefully with better luck.
for RA2, I noticed this: (it needs EMULATESURFACE)
Blt: SRC2EMU src=(0,0)-(800,600) dest=(4,23)-(804,623) at 2339
Blt: BACK2PRIM src=(0,0)-(800,600) dest=(4,23)-(804,623) at 2339
and the blt drawings are starting in dest position in the emulated suface! so doubling the offset fix here?
dest=(4,23)-(804,623) should be the fixed rectangle position to take into account for the window borders. Doubling it doesn't fix the discrepancies between ddraw and GDI behaviour.
Anyway, you're right: it's time to revise the RA2 support, now that so many updates were made.