Skip to main content
gamedev.net
🔒 Locked

Manipulate windows screen

Started by kekk0 Jan 20, 2008 at 11:01 AM 4 replies 850+ views
Original Post
kekk0
kekk0
Hi, I'm looking for a way to manipulate the screen image while using windows, i.e. apply a transparent watermark on the screen during normal use, preferably only in the windows gdi (no games/videos running). Does anyone know a way to do this? Thanks in advance!
LessBread
LessBread
There are a couple of articles at Angelcode Resources that might point you on your way.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
kekk0
kekk0
Hi LessBread,
thanks for your reply. Actually what I am looking for is a way to read and write on the whole screen, including windows, taskbar, menus and everything else. The samples I found on angelcode just write on the desktop wallpaper.
Thanks for any help.
Endurion
Endurion
The brutal (but very unclean) way is to access the desktop DC directly. This will cause a lot of flickering though, so not preferrable.

The other way, since Windows 2000 you can do layered windows, they allow for alpha transparency. Combine that with regions and make them not appear clickable and there's your watermark.
Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>
LessBread
LessBread
Quote:
Original post by kekk0
Hi LessBread,
thanks for your reply. Actually what I am looking for is a way to read and write on the whole screen, including windows, taskbar, menus and everything else. The samples I found on angelcode just write on the desktop wallpaper.
Thanks for any help.


I see. The short of that is to get the HDC from the target window using it's HWND and then start drawing. Subclassing the target window helps. Look up user drawn windows. Check out the tutorials at catch22.net.
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Structural
Structural
Quote:
Original post by Endurion
The brutal (but very unclean) way is to access the desktop DC directly. This will cause a lot of flickering though, so not preferrable.

The other way, since Windows 2000 you can do layered windows, they allow for alpha transparency. Combine that with regions and make them not appear clickable and there's your watermark.


I tried this once (something along the lines of GetDC(0), where '0' is the window handle of the desktop).
It's a tricky process as the framebuffer will not "clean" itself. So whatever you put on the framebuffer will stay there until you explicitly invalidate that part of the screen. So when you move a window over that part of the screen, whatever you drew there will be gone.

I have to agree with Endurion, the transparent window is a much cleaner solution in my opinion.
STOP THE PLANET!! I WANT TO GET OFF!!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.