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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
API之网络函数1. API之网络函数 WNetAddConnection 创建同一个网络资源的永久性连接 WNetAddConnection2 创建同一个网络资源的连接 WNetAddConnection3 创建同一个网络资源的连接 WNetCancelConnection 结束一个网络连接 WNetCancelConnection2 结束一个网络连接 WNetCloseEnum 结束一次枚举操作 WNetConnectionDialog 启动一个标准对话框,以便建立同网络资源的连接 WNetDisconnectDialog 启动一个标准对话框,以便断开同网络资源的连接 WNetEnumResource 枚举网络资源 WNetGetConnection 获取本地或已连接的一个资源的网络称 WNetGetLastError 获取网络错误的扩展错误信息 WNetGetUniversalName 获取网络中一个文件的远程称以及/或者UNC(统一命规范)称 WNetGetUser 获取一个网络资源用以连接的字 WNetOpenEnum 启动对网络资源进行枚举的过程 2. API之消息函数 BroadcastSystemMessage 将一条系统消息广播给系统中所有的顶级窗口 GetMessagePos 取得消息队列中上一条消息处理完毕时的鼠标指针屏幕位置 GetMessageTime 取得消息队列中上一条消息处理完毕时的时间 PostMessage 将一条消息投递到指定窗口的消息队列 PostThreadMessage 将一条消息投递给应用程序 RegisterWindowMessage 获取分配给一个字串标识符的消息编号 ReplyMessage 答复一个消息 SendMessage 调用一个窗口的窗口函数,将一条消息发给那个窗口 SendMessageCallback 将一条消息发给窗口 SendMessageTimeout 向窗口发送一条消息 SendNotifyMessage 向窗口发送一条消息 3. API之文件处理函数 CloseHandle 关闭一个内核对象。其中包括文件、文件映射、进程、线程、安全和同步对象等 CompareFileTime 对比两个文件的时间 CopyFile 复制文件 CreateDirectory 创建一个新目录 CreateFile 打开和创建文件、管道、邮槽、通信服务、设备以及控制台 CreateFileMapping 创建一个新的文件映射对象 DeleteFile 删除指定文件 DeviceIoControl 对设备执行指定的操作 DosDateTimeToFileTime 将DOS日期和时间值转换成一个 win32 FILETIME 值 FileTimeToDosDateTime 将一个 win32 FILETIME 值转换成DOS日期和时间值 FileTimeToLocalFileTime 将一个FILETIME结构转换成本地时间 FileTimeToSystemTime 根据一个FILETIME结构的内容,装载一个SYSTEMTIME结构 FindClose 关闭由FindFirstFile函数创建的一个搜索句柄 FindFirstFile 根据文件查找文件 FindNextFile 根据调用FindFirstFile函数时指定的一个文件查找下一个文件 FlushFileBuffers 针对指定的文件句柄,刷新内部文件缓冲区 FlushViewOfFile 将写入文件映射缓冲区的所有数据都刷新到磁盘 GetBinaryType 判断文件是否可以执行 GetCompressedFileSize 判断一个压缩文件在磁盘上实际占据的字节数 GetCurrentDirectory 在一个缓冲区中装载当前目录 GetDiskFreeSpace 获取与一个磁盘的组织有关的信息,以及了解剩余空间的容量 GetDiskFreeSpaceEx 获取与一个磁盘的组织以及剩余空间容量有关的信息 GetDriveType 判断一个磁盘驱动器的类型 GetExpandedName 取得一个压缩文件的全 GetFileAttributes 判断指定文件的属性 GetFileInformationByHandle 这个函数提供了获取文件信息的一种机制 GetFileSize 判断文件长度 GetFileTime 取得指定文件的时间信息 GetFileType 在给出文件句柄的前提下,判断文件类型 GetFileVersionInfo 从支持版本标记的一个模块里获取文件版本信息

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值