拦截处理ToolBar的WM_ERASEBKGND消息
自己绘制背景
这一类的程序 原理简单、代码量大,除非非常闲,别人一般不会写的WM_ERASEBKGND
An application sends the WM_ERASEBKGND message when the window background must be erased (for example, when a window is resized). The message is sent to prepare an invalidated portion of a window for painting. WM_ERASEBKGND
hdc = (HDC) wParam; // handle to device context
Parameters
hdc
Value of wParam. Handle to the device context.
Return Values
An application should return nonzero if it erases the background; otherwise, it should return zero. Res
The DefWindowProc function erases the background by using the class background brush specified by the hbrBackground member of the WNDCLASS structure. If hbrBackground is NULL, the application should process the WM_ERASEBKGND message and erase the background. An application should return nonzero in response to WM_ERASEBKGND if it processes the message and erases the background; this indicates that no further erasing is required. If the application returns zero, the window will remain ed for erasing. (Typically, this indicates that the fErase member of the PAINTSTRUCT structure will be TRUE.) QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winuser.h.
自己绘制背景
这一类的程序 原理简单、代码量大,除非非常闲,别人一般不会写的WM_ERASEBKGND
An application sends the WM_ERASEBKGND message when the window background must be erased (for example, when a window is resized). The message is sent to prepare an invalidated portion of a window for painting. WM_ERASEBKGND
hdc = (HDC) wParam; // handle to device context
Parameters
hdc
Value of wParam. Handle to the device context.
Return Values
An application should return nonzero if it erases the background; otherwise, it should return zero. Res
The DefWindowProc function erases the background by using the class background brush specified by the hbrBackground member of the WNDCLASS structure. If hbrBackground is NULL, the application should process the WM_ERASEBKGND message and erase the background. An application should return nonzero in response to WM_ERASEBKGND if it processes the message and erases the background; this indicates that no further erasing is required. If the application returns zero, the window will remain ed for erasing. (Typically, this indicates that the fErase member of the PAINTSTRUCT structure will be TRUE.) QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winuser.h.
http://www.dapha.net/vb/list.asp?id=1112代码名称 有背景图片的Treeview
代码类型 图形图像
运行环境 Win9x/WinNT/Win2000/WinME
授权方式 共享软件
代码大小 13K
代码评价
上传时间 2001-12-14
相关链接 主页
本日下载 1 本周:21 总计:21
下载地址1 下载
代码简介 有背景图片的Treeview.