Example #1
0
void Ivy::System::Win32Window::Close()
{
    RemoveProp(hWnd, TEXT("WINDOW"));
    UnregisterWindowClass();
    DestroyWindow(hWnd);
    open = false;

    std::cout << "Window closing..." << std::endl;
}
void CSplashScreen::Show() {
	CoInitialize(0);

	// create the named close splash screen event, making sure we're the first process to create it
	SetLastError(ERROR_SUCCESS);

	std::basic_string <TCHAR> strEvent1 = _T("CloseSplashScreenEvent")+m_strPrefix;
	HANDLE hCloseSplashEvent = CreateEvent(NULL, TRUE, FALSE, strEvent1.c_str());

	if (GetLastError() == ERROR_ALREADY_EXISTS) {
		ExitProcess(0);
	}

	std::basic_string <TCHAR> strEvent2 = _T("CloseSplashScreenWithoutFadeEvent")+m_strPrefix;
	HANDLE hCloseSplashWithoutFadeEvent = CreateEvent(NULL, TRUE, FALSE, strEvent2.c_str());
	if (GetLastError() == ERROR_ALREADY_EXISTS) {
		ExitProcess(0);
	}

	HBITMAP hb = m_pImgLoader->LoadSplashImage();
	HWND wnd= NULL;
	RegisterWindowClass();

	if (hb!=NULL) {
		wnd=CreateSplashWindow();
		SetSplashImage(wnd, hb);
	}

	// launch the WPF application
	HANDLE hProcess = LaunchWpfApplication();

	AllowSetForegroundWindow(GetProcessId(hProcess));

	if (wnd!=NULL) {
		// display the splash screen for as long as it's needed
		HANDLE aHandles[3] = { hProcess, hCloseSplashEvent, hCloseSplashWithoutFadeEvent };
		PumpMsgWaitForMultipleObjects(wnd, 3, &aHandles[0], INFINITE);
	}

	CloseHandle(hCloseSplashEvent);
	CloseHandle(hCloseSplashWithoutFadeEvent);

	UnregisterWindowClass();
}
Example #3
0
	void FirstSample::Destroy()
	{
		UnregisterWindowClass("EngineClass");
           
        SafeDelete(mTextureManager);
        SafeDelete(mProgramManager);
        SafeDelete(mRenderQueue);
        SafeDelete(mCamera);
        SafeDelete(mCube);
		SafeDelete(mGraphicsDevice);
		SafeDelete(mWindow);
		SafeDelete(mTimer);
        SafeDelete(mKeyboard);
        SafeDelete(mMouse);
        SafeDelete(mFileSystem);
		SafeDelete(mCoreFactory);
		SafeDelete(mGraphicsFactory);
		SafeDelete(mLogger);
	}
Example #4
0
extern "C" int __declspec(dllexport) Unload()
{
	if (hLTEdgesPen)
		DeleteObject(hLTEdgesPen);
	if (hRBEdgesPen)
		DeleteObject(hRBEdgesPen);
	if (hBmpBackground)
		DeleteObject(hBmpBackground);
	if (hBkBrush) {
		SetClassLong((HWND)WND_CLASS, GCLP_HBRBACKGROUND, (LONG)NULL);
		DeleteObject(hBkBrush);
		hBkBrush = NULL;
	}

	for (int nFontId = 0; nFontId < FLT_FONTIDS; nFontId++)
		if (NULL != hFont[nFontId])
			DeleteObject(hFont[nFontId]);

	UnregisterWindowClass();
	return 0;
}
Example #5
0
void SpinControlCleanup (void)
{
    UnregisterWindowClass (CTRL_SPINBOX);
}
Example #6
0
void AnimationControlCleanup (void)
{
    UnregisterWindowClass (CTRL_ANIMATION);
}