我完全是win32的新手。過去48小時我一直在努力。是否有必要使用InitCommonControlsEx()和InitCommonControls()?
我試圖建立一個「網格」,我得到了一個列表視圖控件和msdn.microsoft.com上一個頭控制的例子。
第一個調用InitCommonControls()函數(除了我讀這個函數已經過時了)。
HWND DoCreateHeader(HWND hwndParent, HINSTANCE hInst)
{
HWND hwndHeader;
RECT rcParent;
HDLAYOUT hdl;
WINDOWPOS wp;
// Ensure that the common control DLL is loaded, and then create
// the header control.
InitCommonControls();
// ...
// hwndHeader = CreateWindowEx(0, WC_HEADER, ...
}
第二個調用InitCommonControlsEx()函數。
HWND CreateListView (HWND hwndParent, HINSTANCE hInst)
{
RECT rcl;
INITCOMMONCONTROLSEX icex;
// Ensure that the common control DLL is loaded.
icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
icex.dwICC = ICC_LISTVIEW_CLASSES;
InitCommonControlsEx(&icex);
// ...
// HWND hWndListView = CreateWindow(WC_LISTVIEW ...
}
似乎這些函數需要comctl32.lib庫,但下載它是一團糟。
此外我已經注意到,如果我刪除這些功能,一切都保持正常工作。 那麼,他們有必要嗎?
謝謝!
天啊!謝謝!我沒有注意到它是在 c:\ Program Files \ Microsoft SDKs \ Windows \ v6.0A \ Lib – kiewic 2009-04-07 18:13:22