force redraw

This topic is 3640 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Anyone who knows how to force window repaint for all windows that are below a specific one? Any help appreciated! -GM

Share on other sites
Simply invalidate them and it will force a repaint.

For a specific area of specific windows you iterate through all the windows calling InvalidateRgn() or InvalidateRect().

If you just want to invalidate that part of ALL windows (rather than just those below it) leave the hWnd parameter as NULL.

Share on other sites
Oh man, it doesn't work, here is a snips of what i do:

HWND hW = hWnd;while ( (hW2 = GetNextWindow(hW,GW_HWNDNEXT)) != NULL ) {	if (hW2!=NULL) {		DWORD st = GetWindowLongPtr(hW2,GWL_STYLE);		// only top & visible windows		if ( (st&WS_OVERLAPPEDWINDOW) && (st&WS_VISIBLE) ) {			InvalidateRect(hW2,NULL,true);		}		hW = hW2;	}}

Nothing happens, i do that when my window become active(WM_NCACTIVE message) i'd like to force all windows below me to be redrawn on top of me so that at that moment my window has been totally removed.

cheers

Share on other sites
How are you drawing your window? Are you drawing it inside your message proc in the WM_PAINT message? If you are, you can resend a WM_PAINT message to your window when you want to redraw.

Share on other sites
Nope, i'm only drawing over the non-client area, i've overridden the ncpaint only, i'm hooking a different window not mine, i think there isn't much left to do with it, i've tried so many different ways without any good result so far, just last few tries and i think not to go any further with it, anyway thank you dude!

1. 1
Rutin
32
2. 2
3. 3
4. 4
5. 5

• 11
• 13
• 86
• 11
• 10
• Forum Statistics

• Total Topics
632972
• Total Posts
3009613
• Who's Online (See full list)

There are no registered users currently online

×