Just for fun, I handled the WM_NCPAINT message for a window and just returned 0. I was surprised however to find that clicking another window, then returning to my window, resulted in the entire frame being drawn on. Is there another message that can redraw the frame? Also, if I drag the window around rapidly by dragging on the caption bar, the frame becomes garbled and distorted. Any ideas?
I would assume that the WM_NCACTIVATE message is also being sent.
If I now wanted to paint my own frame, what would I do? I've had a look at the GetRegionData() function and all that, but I'm a bit stumped on how to set up my buffer so it's big enough. Would I have to specify a small buffer, get the return value, then specify the adequate buffer? And then, how would I know which rectangle specified which part of the frame? It's all so complicated.
There are limitations to making your own frames. If you try to access the window menu (In the top left corner of the window), for example, Microsoft decided that would be a good time to redraw the titlebar icons internally, so it'll draw over anything you've done.
When I did it, I didn't actually change the size or shape of the frame from the default, but it could be drawn to by GetWindowDC(hwnd). Not sure if you're trying to be spiffy, though. :cool:
I'm really lost here. The GetRegionData() function seems infintely difficult to use. I don't understand how to set the array size properly, and plus, when I did the following, it return 0:
The Win32 Programmer's Reference claims that my code should return the required array size, but it only returned 0. Why wont it work?