U E D R , A S I H C RSS

Direct Draw/API Basis Source

žพธ ˜ธฐ €ฐฎ€ œˆ„šฐฆˆ ธฐณธœกœ งŒ“คธฐ!

~cpp 

#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif

#include <windows.h>

LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	MSG	 msg;
	HWND	 hWnd;
	WNDCLASS	 wc;
	
	wc.lpszClassName = "DXTEST";
	wc.lpfnWndProc   = WndProc;
	wc.style         = CS_VREDRAW | CS_HREDRAW;
	wc.hInstance     = hInstance;
	wc.hIcon         = LoadIcon( NULL, IDI_APPLICATION );
	wc.hCursor       = LoadCursor( NULL, IDC_ARROW );
	wc.hbrBackground = (HBRUSH) (GetStockObject(BLACK_BRUSH));
	wc.lpszMenuName  = NULL;
	wc.cbClsExtra    = 0;
	wc.cbWndExtra    = 0;
    
	RegisterClass( &wc );
	hWnd = CreateWindowEx( 0, "DXTEST", "DXTEST",
			WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT,
			CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL );
	ShowWindow(hWnd, nCmdShow);
	UpdateWindow(hWnd);

	while(true)
	{
		if( PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )
		{
			if( 0 == GetMessage(&msg, NULL, 0, 0 ) )
			{
				// WM_QUIT was posted, so exit
				return (int)msg.wParam;
			}

			// Translate and dispatch the message
			TranslateMessage( &msg ); 
			DispatchMessage( &msg );
		}
		else
		{
			// ดณณ—” ฉ”„€ ฐ›€ •Š•˜„•Œ ํ•˜Š” „  –ด€‹ค.
			// ทธž˜ํ”ฝ ํ‘œ‹œ˜€.. ธฐํƒ€ ““..
		}
	}
	return (int)msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch(msg)
	{
	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	}
	return DefWindowProc(hWnd, msg, wParam, lParam);
}

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:23:08
Processing time 0.0072 sec