CreateWindowEx et DialogBox
SAlut,
je voudrais savoir comment utiliser la fonction DialogBox() dans un CreateWindowEx afin de mettre une list view dans une resource,
Car pour la crée j'ai :
Code:
1 2 3 4
| ListView = CreateWindow(WC_LISTVIEW,NULL,
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | LVS_REPORT,
0,0,RectParent.right-0,RectParent.bottom-0,
hWnd, NULL, hinst, NULL); |
et le winmain :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR, int )
{
WNDCLASSEX wc;
HWND hDlg;
MSG msg;
InitCommonControls();
// ******************************* création class principale
wc.cbSize = sizeof(WNDCLASSEX);
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
wc.hCursor = LoadCursor( NULL, IDC_ARROW );
wc.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wc.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wc.hInstance = hinst;
wc.lpfnWndProc = WinProc;
wc.lpszClassName = APP_NAME;
wc.lpszMenuName = MAKEINTRESOURCE(1000);
wc.style = CS_HREDRAW | CS_VREDRAW;
if (!RegisterClassEx( &wc ))
{
MessageBox (NULL, "probleme d'initialisation ..." , "Mince alors !", 0 + MB_ICONHAND);
return 0;
}
// ******************************* création fenetre principale
hDlg = CreateWindowEx(0,APP_NAME,APP_NAME,
WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS,10, 10,780, 520,
NULL, NULL, hinst, NULL);
ShowWindow( hDlg, SW_SHOW );
UpdateWindow( hDlg );
while( GetMessage( &msg, 0, 0, 0 ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
return msg.wParam;
} |
Ou alors tout simplement comment remplacer listview=CreateWindow....
par le resource du .rc (dsl je sais pas comment le dire) :
Code:
CONTROL "", 108, "SysListView32", 0x241 | WS_BORDER, 9, 9, 384, 140
Merci
Dite moi si vous avez pas compris...car je sais que j'ai surment mal expliqué :cry: ...