What are the proper API calls to clear the client area of text ..bmps etc

There is not a clear item in the help files to do this...only fragments.

BTW...bill gates is a thief
Posted on 2003-01-04 23:57:13 by IwasTitan

have a look at "InvalidateRect" as I think this is what you are after. Either spec the RECT that fits where you want to erase or just set the RECT fr the whole Client area.

GetClientRect will be useful to you there.


Posted on 2003-01-05 02:19:55 by hutch--
Source: http://msdn.microsoft.com

The InvalidateRect function adds a rectangle to the specified window's update region. The update region represents the portion of the window's client area that must be redrawn.

BOOL InvalidateRect(
HWND hWnd, // handle to window
CONST RECT* lpRect, // rectangle coordinates
BOOL bErase // erase state

Handle to the window whose update region has changed. If this parameter is NULL, the system invalidates and redraws all windows, and sends the WM_ERASEBKGND and WM_NCPAINT messages to the window procedure before the function returns.
Pointer to a RECT structure that contains the client coordinates of the rectangle to be added to the update region. If this parameter is NULL, the entire client area is added to the update region.
Specifies whether the background within the update region is to be erased when the update region is processed. If this parameter is TRUE, the background is erased when the BeginPaint function is called. If this parameter is FALSE, the background remains unchanged.

Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Windows NT/2000/XP: To get extended error information, call GetLastError.

The invalidated areas accumulate in the update region until the region is processed when the next WM_PAINT message occurs or until the region is validated by using the ValidateRect or ValidateRgn function.

The system sends a WM_PAINT message to a window whenever its update region is not empty and there are no other messages in the application queue for that window.

If the bErase parameter is TRUE for any part of the update region, the background is erased in the entire region, not just in the specified part.
Example Code

For an example, see Invalidating the Client Area.

Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Winuser.h; include Windows.h.
Library: Use User32.lib.

Letting lpRect be zero will invalidate the entired client area, no need to call GetClientRect this time.
Set bErase to true and the client area will be cleared, if used in a loop then there might be some flickering...

btw:: Iwastitan, I know, it's also his fault that DOS died, that makes him a murderer! :eek:
Posted on 2003-01-05 07:09:10 by scientica
thank you


Very simple
Posted on 2003-01-06 20:18:16 by IwasTitan