invalidating everything on screen

  • Thread starter Thread starter wanderer
  • Start date Start date
W

wanderer

My application will sometimes draw over the start menu
and form title bar. Is there an easy way to tell
everything on screen to redraw itself? If not, how do I
get a handle on the Start Menu Task Bar? Thanks.
 
I am not sure what you're trying to do here, but calling
Control.Invalidate() should redraw the whole client area...
 
yes, this.Invalidate() or Control.Invalidate() will only
invalidate the current form/control. Unfortunately, I
have drawn over the Main Menu Bar (one with the start
menu button) and the Keyboard pop-up button at the bottom
of the screen. Those will NOT redraw by calling
this.Invalidate() or Control.Invalidate(). What I need is
to know how to get a handle on the Main Menu bar, the
form title bar, and the Keyboard pop-up so I can call
invalidate on those components. Alternatively, if there's
an easy way to invalidate everything that's on screen,
that'd be nice too :) Any ideas? Thanks.

(I didn't need a handle to these to draw b/c I used an
API that wrote to a screen buffer that could Blit to
screen)
 
Doesn't InvalidateRect require a handle to the window? I
thought it specifies a rect for a particular window. Then
I'd still need to get a handle on the Main Menu Bar, etc.
right? Which InvalidateRect() function are you referring
to that specifies screen rectangles (as opposed to window
canvas rect)? Thanks.

(no, it's not the GAPI. It's hardware-related API.
However, details of the API are hidden from me, the
client. I just knows it draws over the menu bar and I
want to refresh the menu bar when it's done...)
 
I can't seem to pinvoke the InvalidateRect that you are
referring to.
I've tried the following:
[DllImport("user32")]
internal static extern bool InvalidateRect(int hwnd, ref
RECT lpRect, bool bErase);
However, it has a MethodMissingException.

If i use [DllImport("coredll")] instead, I can get the
WinCE version of InvalidateRect, but unfortunately, it
does not act the same. When passed in NULL, it does
nothing.

"hWnd
Handle to the window whose update region has changed. If
you pass a NULL value for this parameter then
InvalidateRect will take no action and return FALSE. "


How do I get the GDI version that you are talking about?
Or are you referring to yet another InvalidateRect?
Thanks.
 
Back
Top