1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#include <Windows.h>
int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE prevInstance, LPWSTR cmdLine, int cmdShow )
{
UNREFERENCED_PARAMETER( prevInstance );
UNREFERENCED_PARAMETER( cmdLine );
WNDCLASSEX wndClass={ 0 };
wndClass.cbSize=sizeof( WNDCLASSEX );
wndClass.style=CS_HREDRAW | CS_VREDRAW;
wndClass.lpfnWndProc=WndProc;
wndClass.hInstance=hInstance;
wndClass.hCursor=LoadCursor( NULL, IDC_ARROW );
wndClass.hbrBackground=( HBRUSH )( COLOR_WINDOW + 1 );
wndClass.lpszMenuName=NULL;
wndClass.lpszClassName="DX11BookWindowClass";
if( !RegisterClassEx( &wndClass))
return -1;
RECT rc={0,0,640,480};
AdjustWindowRect( &rc, WS_OVERLAPPEDWINDOW, FALSE );
HWND hwnd=CreateWindowA ( "DX11BookWindowClass", "Blank Win32 Window", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, rc.right - rc.left, rc.bottom - rc.top, NULL, NULL, hInstance, NULL );
if( !hwnd )
return -1;
ShowWindow( hwnd, cmdShow );
return 0;
}
|