登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

面包会有的

... ...

 
 
 

日志

 
 

WNDCLASS  

2008-11-07 22:26:58|  分类: VC++ |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

WNDCLASS
The WNDCLASS structure contains the window class attributes that are registered by the RegisterClass function.

This structure has been superseded by the WNDCLASSEX structure used with the RegisterClassEx function. You can still use WNDCLASS and RegisterClass if you do not need to set the small icon associated with the window class.

typedef struct _WNDCLASS {
    UINT       style;
    WNDPROC    lpfnWndProc;
    int        cbClsExtra;
    int        cbWndExtra;
    HINSTANCE  hInstance;
    HICON      hIcon;
    HCURSOR    hCursor;
    HBRUSH     hbrBackground;
    LPCTSTR    lpszMenuName;
    LPCTSTR    lpszClassName;
} WNDCLASS, *PWNDCLASS;
Members
style
Specifies the class style(s). This member can be any combination of the class styles.
lpfnWndProc
Pointer to the window procedure. You must use the CallWindowProc function to call the window procedure. For more information, see WindowProc.
cbClsExtra
Specifies the number of extra bytes to allocate following the window-class structure. The system initializes the bytes to zero.
cbWndExtra
Specifies the number of extra bytes to allocate following the window instance. The system initializes the bytes to zero. If an application uses WNDCLASS to register a dialog box created by using the CLASS directive in the resource file, it must set this member to DLGWINDOWEXTRA.
hInstance
Handle to the instance that contains the window procedure for the class.
hIcon
Handle to the class icon. This member must be a handle to an icon resource. If this member is NULL, the system provides a default icon.
hCursor
Handle to the class cursor. This member must be a handle to a cursor resource. If this member is NULL, an application must explicitly set the cursor shape whenever the mouse moves into the application's window.
hbrBackground
Handle to the class background brush. This member can be a handle to the physical brush to be used for painting the background, or it can be a color value. A color value must be one of the following standard system colors (the value 1 must be added to the chosen color). If a color value is given, you must convert it to one of the following HBRUSH types:
COLOR_ACTIVEBORDER
COLOR_ACTIVECAPTION
COLOR_APPWORKSPACE
COLOR_BACKGROUND
COLOR_BTNFACE
COLOR_BTNSHADOW
COLOR_BTNTEXT
COLOR_CAPTIONTEXT
COLOR_GRAYTEXT
COLOR_HIGHLIGHT
COLOR_HIGHLIGHTTEXT
COLOR_INACTIVEBORDER
COLOR_INACTIVECAPTION
COLOR_MENU
COLOR_MENUTEXT
COLOR_SCROLLBAR
COLOR_WINDOW
COLOR_WINDOWFRAME
COLOR_WINDOWTEXT

The system automatically deletes class background brushes when the class is unregistered by using UnregisterClass. An application should not delete these brushes.

When this member is NULL, an application must paint its own background whenever it is requested to paint in its client area. To determine whether the background must be painted, an application can either process the WM_ERASEBKGND message or test the fErase member of the PAINTSTRUCT structure filled by the BeginPaint function.

lpszMenuName
Pointer to a null-terminated character string that specifies the resource name of the class menu, as the name appears in the resource file. If you use an integer to identify the menu, use the MAKEINTRESOURCE macro. If this member is NULL, windows belonging to this class have no default menu.
lpszClassName
Pointer to a null-terminated string or is an atom. If this parameter is an atom, it must be a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpszClassName; the high-order word must be zero.
If lpszClassName is a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, or any of the predefined control-class names.

Requirements
  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.
  Unicode: Declared as Unicode and ANSI structures.

See Also
Window Classes Overview, Window Class Structures, BeginPaint, CreateWindow, CreateWindowEx, GetDC, MAKEINTRESOURCE, PAINTSTRUCT, RegisterClass, UnregisterClass, WNDCLASSEX, WindowProc, WM_PAINT

 

 

--------------------------------------------------------------

WNDCLASS
该WNDCLASS结构包含窗口类属性,是注册的RegisterClass功能。

这种结构已被取代的WNDCLASSEX结构用于RegisterClassEx功能。您仍然可以使用WNDCLASS和RegisterClass如果你不需要设置小图标相关的窗口类。

typedef结构_WNDCLASS (
    单元风格;
     WNDPROC lpfnWndProc ;
    整数cbClsExtra ;
    整数cbWndExtra ;
     HINSTANCE hInstance ;
     HICON hIcon ;
     HCURSOR hCursor ;
     HBRUSH hbrBackground ;
     LPCTSTR lpszMenuName ;
     LPCTSTR lpszClassName ;
) WNDCLASS * PWNDCLASS ;
会员
风格
指定类风格(星期日) 。这成员国可任意组合的阶级作风。
lpfnWndProc
指针的窗口程序。您必须使用CallWindowProc函数调用程序的窗口。如需详细资讯,请WindowProc 。
cbClsExtra
指定一些额外的字节分配如下的窗口类结构。该系统初始化字节为零。
cbWndExtra
指定一些额外的字节分配如下的窗口实例。该系统初始化字节为零。如果一个应用程序使用WNDCLASS注册一个对话框,创建使用类指令的资源文件,它必须设定这个成员DLGWINDOWEXTRA 。
hInstance
处理的实例,其中包含的窗口程序的类。
hIcon
处理的阶级图标。这成员国必须处理的图标资源。如果这个成员为NULL ,该系统提供了一个默认图标。
hCursor
处理的类光标。这成员国必须有一个处理一个光标资源。如果这个成员为NULL ,应用程序必须明确设置光标形状时,鼠标进入应用程序的窗口。
hbrBackground
处理的阶级背景刷。这成员国可以处理的实际刷,用于绘画的背景,也可以是一个颜色值。颜色值必须是下列标准系统颜色(值1必须加入所选择的颜色) 。如果颜色值是,你必须转换为下列其中一个HBRUSH类型:
COLOR_ACTIVEBORDER
COLOR_ACTIVECAPTION
COLOR_APPWORKSPACE
COLOR_BACKGROUND
COLOR_BTNFACE
COLOR_BTNSHADOW
COLOR_BTNTEXT
COLOR_CAPTIONTEXT
COLOR_GRAYTEXT
COLOR_HIGHLIGHT
COLOR_HIGHLIGHTTEXT
COLOR_INACTIVEBORDER
COLOR_INACTIVECAPTION
COLOR_MENU
COLOR_MENUTEXT
COLOR_SCROLLBAR
COLOR_WINDOW
COLOR_WINDOWFRAME
COLOR_WINDOWTEXT

该系统会自动删除阶级背景刷子当类是未经注册的使用UnregisterClass 。申请不应该删除这些刷子。

当这个成员为NULL ,应用程序必须画自己的背景时,要求涂料在其客户区。以确定是否必须背景画,应用程序可以处理WM_ERASEBKGND讯息或测试转移成员PAINTSTRUCT结构填补BeginPaint功能。

lpszMenuName
指向一个空结束的字符串指定的资源名称级菜单,因为名字出现在资源档案。如果您使用一个整数,确定菜单,使用MAKEINTRESOURCE宏。如果这个成员为NULL ,窗户属于这一类没有默认的菜单。
lpszClassName
指向一个空结束的字符串或者是一个原子。如果此参数是一个原子,它必须是一个一流的原子所造成的前呼吁RegisterClass或RegisterClassEx功能。原子必须在低阶字lpszClassName ;高阶字必须是零。
如果lpszClassName是一个字符串,它指定窗口类的名称。类的名称可以是任何名义注册RegisterClass或RegisterClassEx ,或任何预先确定的控制类名。

要求
  的Windows NT/2000/XP :包含在Windows NT 3.1和更高版本。
   Windows 95/98/Me中:包含在Windows 95和更高版本。
  标题:中宣布的Winuser.h ;包括Windows.h 。
  的Unicode :申报为Unicode和ANSI结构。

另请参阅
窗口类的概况,窗口类的结构, BeginPaint , CreateWindow , CreateWindowEx , GetDC , MAKEINTRESOURCE , PAINTSTRUCT , RegisterClass , UnregisterClass , WNDCLASSEX , WindowProc , WM_PAINT

 


 

  评论这张
 
阅读(689)| 评论(0)

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018