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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
#include <windows.h>
#include "WinClass.h"
WinClassMain::WinClassMain(HINSTANCE hInstance, WNDPROC WndProc): WinClassPara (hInstance)
{
wc.lpfnWndProc = WndProc;
DeclareWinProp();
}
void WinClassMain::DeclareWinProp()
{
wc.lpszClassName = GetwcName();
wc.hInstance = GethInst ();
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wc.hCursor = LoadCursor(0, IDC_ARROW);
wc.cbSize = sizeof(wc);
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
}
void WinClassMain::RegisterWin()
{
RegisterClassEx(&wc);
}
// And also here, where i need the parameters again.
WinCreator::WinCreator ():_hwnd (0), wc (), ExStyle (0), WinName (0), Style (WS_OVERLAPPED), xPos (CW_USEDEFAULT), yPos (0), cHeight (CW_USEDEFAULT), cWidth (0), WinOwn (0), Menu (0), Data (0)
{
}
void WinCreator::CreateWin()
{
CreateWindowEx(ExStyle, GetwcName(), WinName, Style, xPos, yPos, cHeight, cWidth, WinOwn, Menu, GethInst (), Data);
}
void WinCreator::ShowWin(int nShowWin)
{
::ShowWindow (_hwnd, nShowWin);
::UpdateWindow (_hwnd);
}
|