#pragma comment(linker,"/subsystem:windows")
#include <windows.h>
LRESULT CALLBACK WndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch( msg )
{
case WM_CREATE:
return 0;
case WM_LBUTTONDOWN:
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc( hwnd, msg, wParam, lParam);
}
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrev, LPSTR lpCmdLine, int nShowCmd)
{
MSG msg;
HWND hwnd;
WNDCLASS wc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hbrBackground = (HBRUSH)GetStockObject( WHITE_BRUSH);
wc.hCursor = LoadCursor( 0, IDC_ARROW );
wc.hIcon = LoadIcon( 0, IDI_WINLOGO);
wc.hInstance = hInstance;
wc.lpfnWndProc = WndProc;
wc.lpszClassName = "First";
wc.lpszMenuName = 0;
wc.style = 0;
if ( RegisterClass(&wc) == 0 )
{
MessageBox( 0, "Can't Register Class", "Error", MB_OK);
return -1;
}
hwnd = CreateWindowEx( 0, "First", "Hello", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0,0, hInstance, 0);
ShowWindow( hwnd, SW_SHOW);
UpdateWindow( hwnd );
while( GetMessage( &msg, 0, 0, 0) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
return msg.wParam;
}
"이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다."