Able to show a Win32 window frame, unable to successfully show its background.

Started by
1 comment, last by tom_mai78101 12 years, 8 months ago
Here's my problem.

I am currently testing a new technique I'm learning from Gamedev.net. So far, not really good. I have been able to successfully create a window, move/drag it around, and close it (destroy it). The only big problem is that I'm not able to make it show its background color, even though I have provided it a CreateSolidBrush() with a macro RGB() in the window class. The RGB values are 10, 50, 100, and don't know what are the values to make it completely transparent, if it even existed in the macro.

The background is completely transparent. There aren't any values that I've placed that makes it transparent, nor know how to make a transparent code. Below, I have given the project ZIP folder, containing only source codes, and a picture of what it looked like as of now.

WM_PAINT works, able to route it to GetUpdateRect() and ValidateRect(), finishing the caught message by returning 0, and still like this.


Capture-3.png

Props to those who can help fix this unusual issue I'm having. It's perfectly Win32. No DirectX or OpenGL libraries in the way.
Thanks in advance.
Advertisement
You have a weird way of zipping :)

For your problem: You did specify a brush for the background, but in your WndProc you handle WM_ERASEBKGND and return 1. This tells Windows that you successfully repainted the background already.

If you comment out your WM_ERASEBKGND handler DefWindowProc handles the messages and uses the supplied brush:


/*case WM_ERASEBKGND:
return 1;*/

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

Oh right! A common copy/paste error. :/

Thank you! :D

This topic is closed to new replies.

Advertisement