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
| LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
switch (uMsg)
{
case WM_CREATE:
Presenter_Create ();
return 0;
case WM_COMMAND:
// Si le bouton "créer la forme" est pressé
if (LOWORD(wParam) == IDC_Create_Shape_Button)
{
Presenter_On_Create_Shape_Button (hwnd_create_shape_edit, hwnd_recognized_shape, hwnd_correct_shape_combobox);
}
break;
case WM_PAINT:
{
// Ecrit les différents labels de la fenêtre principale
hdc = BeginPaint(hwnd, &ps);
TextOut(hdc, 12, 5, L"Drawn shape", 11);
TextOut(hdc, 402, 5, L"Recognized shape", 16);
TextOut(hdc, 230, 25, L"Shape name to create :", 22);
TextOut(hdc, 230, 130, L"Shape name to correct :", 24);
EndPaint(hwnd, &ps);
}
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
default:
return DefWindowProc(hwnd, uMsg, wParam, lParam);
} |