win32_step_2 - 8BitsCoding/RobotMentor GitHub Wiki
- ์ฐธ๊ณ ์ฌ์ดํธ : ์์ธํ ์ค๋ช ์ ์ฌ๊ธฐ ์ฐธ์กฐ(๊ผญ ์ฝ์ด๋ณด๊ณ ์์)
์์ฑ๋ ํ๋ก์ ํธ cppํ์ผ ๋ด๋ถ๋ฅผ ์๋์ ๊ฐ์ด ๊ต์ฒดํ๋ค.
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (uMsg == WM_DESTROY) PostQuitMessage(0);
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASS wc;
wchar_t my_class_name[] = L"tipssoft";
wc.cbClsExtra = NULL;
wc.cbWndExtra = NULL;
wc.hbrBackground = (HBRUSH)COLOR_WINDOW;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hInstance = hInstance;
wc.lpfnWndProc = WndProc;
wc.lpszClassName = my_class_name;
wc.lpszMenuName = NULL;
wc.style = CS_HREDRAW | CS_VREDRAW;
RegisterClass(&wc);
HWND hWnd = CreateWindow(my_class_name, L"www.tipssoft.com",
WS_OVERLAPPEDWINDOW, 100, 90, 400, 350, NULL, NULL, hInstance, NULL);
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
MSG msg;
while (GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
๋น๋ ํ ์คํ