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 46 47 48 49 50 51 52 53 54 55 56
|
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
int width = 600;
int height = 450;
hinst = hInstance;
WNDCLASS wc;
wc.style = CS_OWNDC;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = 0;
wc.hCursor = LoadCursor(0, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW);
wc.lpszClassName = "WindowClass";
wc.lpszMenuName = MAKEINTRESOURCE(IDR_MENU);
if( RegisterClass(&wc) == 0)
return -1;
HWND hWnd = CreateWindow ("WindowClass", "Practical Project 2007",WS_CAPTION | WS_OVERLAPPEDWINDOW |WS_VISIBLE, 100, 100,width,height,NULL,NULL, hInstance, NULL);
CApplication* Appli;
Appli = new CApplication(hWnd,hInstance,vis);
Appli->InitAppli();
ShowWindow(hWnd,nCmdShow);
MSG msg;
ZeroMemory( &msg, sizeof(msg) );
while(msg.message!=WM_QUIT)
{
if(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else
{
Appli->Update();
}
}
Appli->clean();
delete Appli;
return 0;
} |
Partager