#include <windows.h>
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg,
WPARAM Wparam, LPARAM lParam);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPTSTR lpszCmdLine, int nCmdShow)
{
HWND hwnd;
MSG msg;
WND** Wnd**;
Wnd**.style = CS_HREDRAW | CS_VREDRAW;
Wnd**.lpfnWndProc = WndProc;
Wnd**.cbClsExtra = 0;
Wnd**.cbWndExtra = 0;
Wnd**.hInstance = hInstance;
Wnd**.hIcon = LoadIcon(NULL, IDI_APPLICATION);
Wnd**.hCursor = LoadCursor(NULL, IDC_ARROW);
Wnd**.hbrBackground = (HBRUSH)GetStock**(WHITE_BRUSH);
Wnd**.lpszMenuName = NULL;
Wnd**.lpsz**Name = "Windows Title Name";
Register**(&Wnd**);
hwnd = CreateWindow("Windows Title Name",
"Windows Title Name",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL
);
ShowWindow(hwnd, nCmdShow);
UpdateWindow(hwnd);
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg,
WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
switch(iMsg)
{
case WM_CREATE:
break;
case WM_PAINT:
hdc = BeginPaint(hwnd, &ps);
TextOut(hdc, 0, 0, "HelloWorld", 10);
EndPaint(hwnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
}
return DefWindowProc(hwnd, iMsg, wParam, lParam);
}
아는사람 있으려나?
2010.03.13
2010.03.13
2010.03.13