All pastes #2051139 Raw Edit

Someone

public text v1 · immutable
#2051139 ·published 2011-04-27 08:56 UTC
rendered paste body
#include "KWnd.h"
KWnd::KWnd (LPCTSTR windowName, HINSTANCE hInst, int cmdShow,
		LRESULT (WINAPI *pWndProc)(HWND, UINT, WPARAM, LPARAM),
		LPCTSTR menuName, int x, int y, int width, int height,
		UINT classStyle, DWORD windowStyle, HWND hParent) {
			wchar_t szClassName[] = L"KWndClass";
			//  
	wc.cbSize		= sizeof(wc);
	wc.style		= classStyle;
	wc.lpfnWndProc	= pWndProc;
	wc.cbClsExtra	= 0;
	wc.cbWndExtra	= 0;
	wc.hInstance	= hInst;
	wc.hIcon		= LoadIcon (NULL, IDI_APPLICATION);
	wc.hCursor		= LoadCursor (NULL, IDC_ARROW);
	wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); //  HGDIOBJ -    HBRUSH
	wc.lpszMenuName	= menuName;
	wc.lpszClassName = szClassName; //   
	wc.hIconSm		= LoadIcon (NULL, IDI_APPLICATION);
	//   
	if (!RegisterClassEx(&wc)) {
		TCHAR msg [100] = L"    ";
		wcscpy (msg, szClassName);
		MessageBox (NULL, msg, L"Error", MB_OK);
		return;
	}
	//   
	hWnd = CreateWindow (szClassName, windowName, windowStyle,
		x, y, width, height, hParent, (HMENU)NULL, hInst, NULL);
	if (!hWnd) {
		TCHAR text1 [100] = L"    ";
		wcscpy (text1, windowName);
		MessageBox (NULL, text1, L"Error", MB_OK);
		return;
	}
	//  
	ShowWindow (hWnd, cmdShow);
}