Beispiel #1
0
int Win::Main (Win::Instance hInst, char const * cmdParam, int cmdShow)
{
	try
	{
		TheOutput.Init ("Unit Test");
		// Create top window class
		Win::Class::TopMaker topWinClass ("UnitTestClass", hInst);
		topWinClass.Register ();

		// Create Window Controller (needs access to MessagePrepro)
		Win::MessagePrepro msgPrepro;
		TopCtrl ctrl;

		// Create top window (hidden)
		Win::TopMaker topWin ("Unit Test", "UnitTestClass", hInst);
		Win::Dow::Handle appWin = topWin.Create (&ctrl);
		appWin.Show (cmdShow);
		// The main message loop
		return msgPrepro.Pump ();
	}
	catch (Win::Exception e)
	{
		TheOutput.Display (e);
	}
	catch (...)
	{
		Win::ClearError ();
		TheOutput.Display ("Internal error: Unknown exception", Out::Error);
	}
	return 0;
}
Beispiel #2
0
FocusBar::Ctrl * FocusBar::Use::MakeBarWindow (Win::Dow::Handle hwndParent,
											   unsigned id,
											   unsigned associatedId,
											   Focus::Ring & focusRing)
{
	std::auto_ptr<FocusBar::Ctrl> newCtrl (new FocusBar::Ctrl (id, associatedId, focusRing));
	Win::ChildMaker focusMaker (_className, hwndParent, id);
	Win::Dow::Handle win = focusMaker.Create (newCtrl.get ());
	FocusBar::Ctrl * ctrl = newCtrl.get ();
	_ctrls.push_back (newCtrl);
	win.Show ();
	return ctrl;
}