首页 > 代码库 > Win32 SDK程序创建一些控件(简单调用InitCommonControlsEx,并指定ICC_LISTVIEW_CLASSES控件就可以了)
Win32 SDK程序创建一些控件(简单调用InitCommonControlsEx,并指定ICC_LISTVIEW_CLASSES控件就可以了)
在Win32 SDK中创建一些控件的时候需要注意一下(具体是哪些控件请参看MSDN文档中列出来的)
[cpp] view plain copy
- /* 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);
http://blog.csdn.net/visualeleven/article/details/6858157
Win32 SDK程序创建一些控件(简单调用InitCommonControlsEx,并指定ICC_LISTVIEW_CLASSES控件就可以了)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。