api函数名(function):RedrawWindow

RedrawWindow 别名(alias):

RedrawWindow 库名(library):User32

RedrawWindow 操作系统(os):Requires Windows NT 3.1 or later; Requires Windows 95 or later

RedrawWindow 参数表(parameter):

hwnd ----------- Long,要重画的窗口的句柄。零表示更新桌面窗口

lprcUpdate ----- RECT,窗口中需要重画的一个矩形区域

hrgnUpdate ----- Long,一个“区”的句柄,这个区描述了要重画的窗口区域。“区”:Region

fuRedraw ------- Long,规定具体重画操作的旗标。下列常数可组合使用,从而进行复杂的重画行动
RDW_ERASE
重画前,先清除重画区域的背景。也必须指定RDW_INVALIDATE
RDW_FRAME
如非客户区包含在重画区域中,则对非客户区进行更新。也必须指定RDW_INVALIDATE
RDW_INTERNALPAINT
即使窗口并非无效,也向其投递一条WM_PAINT消息
RDW_INVALIDATE
禁用(屏蔽)重画区域
RDW_NOERASE
禁止删除重画区域的背景
RDW_NOFRAME
禁止非客户区域重画(如果它是重画区域的一部分)。也必须指定RDW_VALIDATE
RDW_NOINTERNALPAINT
禁止内部生成或由这个函数生成的任何待决WM_PAINT消息。针对无效区域,仍会生成WM_PAINT消息
RDW_VALIDATE
检验重画区域
RDW_ERASENOW
立即删除指定的重画区域
RDW_UPDATENOW
立即更新指定的重画区域
RDW_ALLCHILDREN
重画操作包括子窗口(前提是它们存在于重画区域)
RDW_NOCHILDREN
重画操作排除子窗口(前提是它们存在于重画区域)


?hWnd
Identifies the window to be redrawn. If this parameter is NULL, the desktop window is updated.

?lprcUpdate
Points to a RECT structure containing the coordinates of the update rectangle. This parameter is ignored if the hrgnUpdate parameter identifies a region.

?hrgnUpdate
Identifies the update region. If both the hrgnUpdate and lprcUpdate parameters are NULL, the entire client area is added to the update region.

?flags
Specifies one or more redraw flags. This parameter can be a combination of flags that invalidate or validate a window, control repainting, and control which windows are affected by RedrawWindow.
The following flags are used to invalidate the window:
RDW_ERASE
Causes the window to receive a WM_ERASEBKGND message when the window is repainted. The RDW_INVALIDATE flag must also be specified; otherwise, RDW_ERASE has no effect.
RDW_FRAME
Causes any part of the nonclient area of the window that intersects the update region to receive a WM_NCPAINT message. The RDW_INVALIDATE flag must also be specified; otherwise, RDW_FRAME has no effect. The WM_NCPAINT message is typically not sent during the execution of RedrawWindow unless either RDW_UPDATENOW or RDW_ERASENOW is specified.
RDW_INTERNALPAINT
Causes a WM_PAINT message to be posted to the window regardless of whether any portion of the window is invalid.
RDW_INVALIDATE
Invalidates lprcUpdate or hrgnUpdate (only one may be non-NULL). If both are NULL, the entire window is invalidated.

The following flags are used to validate the window:
RDW_NOERASE
Suppresses any pending WM_ERASEBKGND messages.
RDW_NOFRAME
Suppresses any pending WM_NCPAINT messages. This flag must be used with RDW_VALIDATE and is typically used with RDW_NOCHILDREN. RDW_NOFRAME should be used with care, as it could cause parts of a window to be painted improperly.
RDW_NOINTERNALPAINT
Suppresses any pending internal WM_PAINT messages. This flag does not affect WM_PAINT messages resulting from a non-NULL update area.
RDW_VALIDATE
Validates lprcUpdate or hrgnUpdate (only one may be non-NULL). If both are NULL, the entire window is validated. This flag does not affect internal WM_PAINT messages.

The following flags control when repainting occurs. RedrawWindow will not repaint unless one of these flags is specified.
RDW_ERASENOW
Causes the affected windows (as specified by the RDW_ALLCHILDREN and RDW_NOCHILDREN flags) to receive WM_NCPAINT and WM_ERASEBKGND messages, if necessary, before the function returns. WM_PAINT messages are received at the ordinary time.
RDW_UPDATENOW
Causes the affected windows (as specified by the RDW_ALLCHILDREN and RDW_NOCHILDREN flags) to receive WM_NCPAINT, WM_ERASEBKGND, and WM_PAINT messages, if necessary, before the function returns.

By default, the windows affected by RedrawWindow depend on whether the given window has the WS_CLIPCHILDREN style. Child windows that are not the WS_CLIPCHILDREN style are unaffected; non-WS_CLIPCHILDREN windows are recursively validated or invalidated until a WS_CLIPCHILDREN window is encountered. The following flags control which windows are affected by the RedrawWindow function:
RDW_ALLCHILDREN
Includes child windows, if any, in the repainting operation.
RDW_NOCHILDREN
Excludes child windows, if any, from the repainting operation.

RedrawWindow 返回值(return):


Long,非零表示成功,零表示失败。会设置GetLastError
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

RedrawWindow 说明(description):


根据fuRedraw旗标的设置,重画全部或部分窗口
The RedrawWindow function updates the specified rectangle or region in a window抯 client area.

RedrawWindow 声明(declare):

Declare Function RedrawWindow Lib "user32" Alias "RedrawWindow" (ByVal hwnd As Long, lprcUpdate As RECT, ByVal hrgnUpdate As Long, ByVal fuRedraw As Long) As Long

 

 

 

BOOL RedrawWindow(
  HWND hWnd,       
// handle of window
  CONST RECT *lprcUpdate,
                   
// address of structure with update rectangle
  HRGN hrgnUpdate,  // handle of update region
  UINT flags        // array of redraw flags
);

Parameters
hWnd
Handle to the window to be redrawn. If
this parameter is NULL, the desktop window is updated.
lprcUpdate
Pointer to a RECT structure containing the coordinates of the update rectangle. This parameter
is ignored if the hrgnUpdate parameter identifies a region.
hrgnUpdate
Handle to the update region. If both the hrgnUpdate and lprcUpdate parameters are NULL, the entire client area
is added to the update region.
flags
Specifies one or more redraw flags. This parameter can be a combination of flags that invalidate or validate a window, control repainting, and control which windows are affected by RedrawWindow.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值