Je suis complètement nouveau à win32. Je travaille dessus depuis 48 heures.Est-il nécessaire d'utiliser InitCommonControlsEx() et InitCommonControls()?
Je suis en train de construire une « grille », et je suis arrivé exemples d'une liste -View contrôle et un contrôle en-tête sur msdn.microsoft.com.
Le premier appelle la fonction InitCommonControls() (à part que j'ai lu cette fonction est obsolète).
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, ...
}
La seconde appelle la fonction 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 ...
}
Semble que ces fonctions ont besoin de la bibliothèque comctl32.lib, mais téléchargez-la.
En outre, j'ai remarqué que si je supprime ces fonctions, tout continue de bien fonctionner. Alors, sont-ils nécessaires?
Merci!
Oh mon dieu! Je vous remercie! Je n'ai pas remarqué que c'était sur c: \ Program Files \ Microsoft SDK \ Windows \ v6.0A \ Lib – kiewic