Réponse acceptée !
Salut, J'ai retrouvé un code que j'avais fait. J'avais sur une même fenêtre un rendu 3D et une interface faite avec l'editeur de ressources Windows.
En voici un extrait:
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
MSG msg; // message from queue BOOL notDone = TRUE; // flag for thread completion HMENU hMenu;
g_hInstance = hInstance;
// Loading windows WNDCLASS wndClass; HWND hWnd;
wndClass.style = CS_HREDRAW | CS_VREDRAW; wndClass.lpfnWndProc = WindowProc; // Fonction gestionnaire d'evenements wndClass.cbClsExtra = 0; wndClass.cbWndExtra = 0; wndClass.hInstance = hInstance; wndClass.hIcon = NULL ; wndClass.hCursor = LoadCursor( NULL, IDC_ARROW ); wndClass.hbrBackground = (HBRUSH) NULL; wndClass.lpszMenuName = NULL; wndClass.lpszClassName = "Class"; RegisterClass( &wndClass );
hMenu = LoadMenu(hInstance, (LPCTSTR)IDR_MENU);
hWnd = CreateWindow( "Class", NULL, WS_OVERLAPPEDWINDOW | WS_SYSMENU , 0, 0, 800, 800, (HWND) NULL, //parent (HMENU)hMenu, //hMenu, hInstance, NULL );
SetWindowText(hWnd, "Title"); ShowWindow(hWnd, nCmdShow/*SW_SHOWMAXIMIZED*/);
hWndParam = CreateDialog(hInstance, MAKEINTRESOURCE(PARAMFRAME), hWnd, WndParamProc);
ShowWindow(hWndParam, TRUE); UpdateWindow(hWnd);
...... }
Le prototype du gestionnaire d'évenements de l'interface: BOOL CALLBACK WndParamProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
Le prototype du gestionnaire des évenements sur la fenêtre mère: LPARAM CALLBACK WindowProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam );
Le prototype du gestionnaire des évenements sur la fenêtre 3D (créée dans le WM_CREATE de WindowProc): LPARAM CALLBACK WndDirect3DProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam );
|