#include <windows.h>
#include "resource.h"
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
{
switch( msg )
{
case WM_DESTROY:
PostQuitMessage( 0 );
return 0;
}
return DefWindowProc( hWnd, msg, wp, lp );
}
HWND Create(HINSTANCE hInst)
{
WNDCLASSEX wc;
wc.cbSize = sizeof(wc);
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInst;
wc.hIcon = (HICON)LoadImage(
hInst,"IDC_SORA", IMAGE_ICON,
0, 0, LR_SHARED
);
wc.hIconSm = wc.hIcon;
wc.hCursor = (HCURSOR)LoadImage(
NULL, MAKEINTRESOURCE(IDC_ARROW), IMAGE_CURSOR,
0, 0, LR_DEFAULTSIZE | LR_SHARED
);
wc.hbrBackground = (HBRUSH)GetStockObject(NULL_BRUSH );
wc.lpszMenuName = NULL;
wc.lpszClassName = "Default Class Name";
if( RegisterClassEx( &wc ) == 0 ){ return NULL; }
return CreateWindow(
wc.lpszClassName,
"Miffy Sora",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInst,
NULL
);
}
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char* pCmdLine, int showCmd)
{
HWND hWnd = Create( hInst );
ShowWindow( hWnd, SW_SHOW );
MSG msg;
while(GetMessage( &msg, NULL, 0, 0 ))
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
return 0;
}