Do games have 100% control of the screen when in focus?

Started by
7 comments, last by crudbreeder 18 years, 10 months ago
Take for example, Half-Life 2. When playing this game, it is maximized and controls what appears on the screen. However, does it have 100% control of what each pixel shows? (Obviously windows errors and problems with the screen can change what appears.) Essentially, is there any way to have a game have 99.9% control, and another program that is able to force a single pixel to a specific color? Is there any way to 'share' focus of the screen amoung various programs? Thanks for the help!
Advertisement
Quote:Original post by Nietsnie
Take for example, Half-Life 2. When playing this game, it is maximized and controls what appears on the screen. However, does it have 100% control of what each pixel shows? (Obviously windows errors and problems with the screen can change what appears.) Essentially, is there any way to have a game have 99.9% control, and another program that is able to force a single pixel to a specific color? Is there any way to 'share' focus of the screen amoung various programs?

Thanks for the help!


I'm quite sure you can use the regular windows text display facilities. Everyone seems to be using bitmap fonts though, because you can get them to look nicer that way. Back in the day, regular windows text display caused horrible slowness problems on my Voodoo 3, but that was most likely a driver issue.

As for another program displaying... I don't think its really standard, and clearly, you wouldn't want to play with the low level driver APIs. It would seem like different processes can't share resource handles. Is there any particular reason you would want to do this? Can't you find a way to make your main program display what your external program want to display, or is it because you want to display something while in a commercial game?

Looking for a serious game project?
www.xgameproject.com
Quote:Original post by Nietsnie
Is there any way to 'share' focus of the screen amoung various programs?

Yes, its called... a window!

More seriously, an app is intended to control everything within its own window, thats the whole point. Tinkering around with another app's drawing surface isn't recommended (or wise, for most apps). However you can snoop around all the open windows, find the one you want and retrive its DC to draw upon (in the same way Spy++ does navigation around another apps controls). I can't remember the specifics though.
Quote:As for another program displaying... I don't think its really standard, and clearly, you wouldn't want to play with the low level driver APIs. It would seem like different processes can't share resource handles. Is there any particular reason you would want to do this? Can't you find a way to make your main program display what your external program want to display, or is it because you want to display something while in a commercial game?
You hit it on the head: I want to display something while my computer is running a commercial game. I don't mind working with low level driver API's if thats what it takes as I am comfortable with x86 ASM.

Quote:More seriously, an app is intended to control everything within its own window, thats the whole point. Tinkering around with another app's drawing surface isn't recommended (or wise, for most apps). However you can snoop around all the open windows, find the one you want and retrive its DC to draw upon (in the same way Spy++ does navigation around another apps controls). I can't remember the specifics though.
Now we're getting somewhere :D. Do you have any links on how to retrieve the DC's of other windows? I know how to get your own windows DC but for other window's I'm kind of lost. I'm going to do a google search right now...


Anybody else have ideas/experience?
i remember playing a patch (yes a cheat) that did this without touching the game files.
Quote:Original post by Nietsnie
Now we're getting somewhere :D. Do you have any links on how to retrieve the DC's of other windows? I know how to get your own windows DC but for other window's I'm kind of lost.

::FindWindow() to get handle to any 'main' window whose name matches provided string. Once you have the handle, ::GetWindowDC() to get the handle to DC.
Is there any way to get all the names of all the windows? I can't just go randomly guessing the name of the window..

And what if the handle to the DC is private? Is their any way to still use it?

Thanks for the help so far, I'm on the track :D
Quote:Original post by Nietsnie
Is there any way to get all the names of all the windows? I can't just go randomly guessing the name of the window..

Windows' Task Manager, Applications tab. =)

More seriously, Microsoft Spy++ which comes with ms Visual Studio can dig up all kind of stuff about things you have currently running. In lack of it, do a google search for "spy++" and you should be able to find similar programs.

(am presuming you want to paint on window of specific program, so you should be able to use one of these ways to find out the program window's name, then have your application use that name to track the right window down... as it's likely to always be the same)
Quote:Original post by Nietsnie
Is there any way to get all the names of all the windows? I can't just go randomly guessing the name of the window..


You can use EnumWindows() to make a list of all the windows.





This topic is closed to new replies.

Advertisement