Laboratorul nr.1 Erhan Serghei
Laboratorul nr.1 Erhan Serghei
1
Erhan Serghei
#include <windows.h>
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
wndclass.lpfnWndProc = WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hbrBackground = (HBRUSH)(0);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = szAppName;
if (!RegisterClass(&wndclass))
szAppName, MB_ICONERROR);
return 0;
}
hwnd = CreateWindow(szAppName,
TEXT("Laboratorul nr.1"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL);
ShowWindow(hwnd, iCmdShow);
UpdateWindow(hwnd);
TranslateMessage(&msg);
DispatchMessage(&msg);
return msg.wParam;
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
HDC hdc;
PAINTSTRUCT ps;
RECT rect;
switch (message)
case WM_PAINT:
GetClientRect(hwnd, &rect);
EndPaint(hwnd, &ps);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;