Etiketler

,

#include <Windows.h>
#include <WindowsX.h>

LRESULT CALLBACK WindowProc(HWND hWnd,
				   UINT message,
				   WPARAM wParam,
				   LPARAM lParam);

int	WINAPI WinMain(HINSTANCE hInstance,
				   HINSTANCE hPrevInstance,
				   LPSTR lpCmdLine,
				   int nCmdShow)
{
	HWND hWnd;

	WNDCLASSEX ps;

	ZeroMemory(&ps, sizeof(WNDCLASSEX));

	ps.cbSize=sizeof(WNDCLASSEX);
	ps.style=CS_HREDRAW | CS_VREDRAW;
	ps.lpfnWndProc=(WNDPROC)WindowProc;
	ps.hInstance=hInstance;
	ps.hCursor=LoadCursor(NULL, IDC_ARROW);
	ps.hbrBackground=(HBRUSH)COLOR_WINDOW;
	ps.lpszClassName=L"PencereSinifi01";

	RegisterClassEx(&ps);

	hWnd=CreateWindowEx(NULL,L"PencereSinifi01",
                            L"arch3ngin33r World",
                            WS_OVERLAPPEDWINDOW
                            ,300,300,500,400,NULL,NULL,
                            hInstance,NULL);

	ShowWindow(hWnd,nCmdShow);

	MSG mesaj;

	while(GetMessage(&mesaj,NULL,0,0))
	{
		TranslateMessage(&mesaj);
		DispatchMessage(&mesaj);
	}

	return mesaj.wParam;
}

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

Ve ortaya cikan...
Reklamlar