Click to See Complete Forum and Search --> : SetFocus


LooFy
March 26th, 2006, 06:31 AM
hey guys I'm trying to do something a little strange with my laptop. I like to play a few video games with people around my dorm, and I realized that I could connect a bunch of zdoom clients together on one machine and then just run a bunch of windows for multiplayer using game pad controllers.

ok here's the problem. Unfortunately, I can't have 4 windows in focus at the same time. If a window is out of focus it doesn't accept keyboard commands, so the idea just kind of goes to hell.

I was thinking that maybe I could write a simple windows program that would rapidly switch between the 4 windows so fast that it felt like they were all in focus simultaneously. I dunno if this would be practical or even possible, and to do it I'd need to be able to retrieve the doom window's hWnd value. Can I do that? does anyone have a better suggestion on how to do this?

thanks.

Bornish
March 26th, 2006, 06:49 AM
One possible (quite difficult but possible) solution is to inject code in the game and call AttachThreadInput() and then subclass these windows with your own implementation; this way, your stub implemetation will be called when any of them has focus.
Another way is to install a "Journal record hook" (WH_JOURNALRECORD, WH_JOURNALPLAYBACK).
Regards,

kirants
March 26th, 2006, 11:16 AM
How bout SendInput API ?