Win32 SDK程序创建一些控件

在Win32 SDK中创建一些控件的时候需要注意一下(具体是哪些控件请参看MSDN文档中列出来的)
/* MSDN:Carries information used to load common control classes from the 
* dynamic-link library (DLL).This structure is used with the InitCommonControlsEx function. 
* 需要使用的结构体和函数
*/
typedef struct tagINITCOMMONCONTROLSEX {
    DWORD dwSize;
    DWORD dwICC;
} INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX;
/*
The set of bit flags that indicate which common control classes will be loaded from 
the DLL.This can be a combination of the following values. 

ICC_ANIMATE_CLASS
Load animate control class. 
ICC_BAR_CLASSES
Load toolbar, status bar, trackbar, and ToolTip control classes. 
ICC_COOL_CLASSES
Load rebar control class. 
ICC_DATE_CLASSES
Load date and time picker control class. 
ICC_HOTKEY_CLASS
Load hot key control class. 
ICC_INTERNET_CLASSES
Load IP address class. 
ICC_LINK_CLASS
Load a hyperlink control class. 
ICC_LISTVIEW_CLASSES
Load list-view and header control classes. 
ICC_NATIVEFNTCTL_CLASS
Load a native font control class. 
ICC_PAGESCROLLER_CLASS
Load pager control class. 
ICC_PROGRESS_CLASS
Load progress bar control class. 
ICC_STANDARD_CLASSES
Load one of the intrinsic User32 control classes. The user controls include button, 
edit, static, listbox, combobox, and scrollbar. 
ICC_TAB_CLASSES
Load tab and ToolTip control classes. 
ICC_TREEVIEW_CLASSES
Load tree-view and ToolTip control classes. 
ICC_UPDOWN_CLASS
Load up-down control class. 
ICC_USEREX_CLASSES
Load ComboBoxEx class. 
ICC_WIN95_CLASSES
Load animate control, header, hot key, list-view, progress bar, status bar, tab, ToolTip, 
toolbar, trackbar, tree-view, and up-down control classes. 
*/
BOOL InitCommonControlsEx(const LPINITCOMMONCONTROLSEX lpInitCtrls);

//  例如创建ListView控件,需要先这样
//  包含相关的头文件和加载对应的lib库文件
#include <commctrl.h>
#pragma comment(lib, "comctl32.lib")

INITCOMMONCONTROLSEX icc = {sizeof(icc), ICC_LISTVIEW_CLASSES};
InitCommonControlsEx(&icc);

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值