Exemple #1
0
ASCDX9Renderer::~ASCDX9Renderer(void)
{
	UnregisterClassW(  L"AscensionWindow", m_hInst );

	for(UINT32 i = 0; i < m_vecVertexBuffers.size(); ++i)
	{
		SafeDelete( m_vecVertexBuffers[i] );
	}

	for(UINT32 i = 0; i < m_vecFonts.size(); ++i)
	{
		SafeDelete( m_vecFonts[i] ); 
	}
	for(UINT32 i = 0; i < m_vecTextToRender.size(); ++i)
	{
		SafeDelete( m_vecTextToRender[i] );
	}

	//Release the device:
	SafeRelease( m_pDevice );
	//Release DirectX
	SafeRelease( m_pD3D );

	SafeDelete( m_pDefaultVertDecl );
	SafeDelete( m_pTextureManager );
	SafeDelete( m_pShaderManager );
}
void flifPreviewHandler::destroyPreviewWindowData()
{
    if (_preview_window)
    {
        _preview_window = 0;
        _image_window = 0;
        _play_button = 0;
        _frame_scrollbar = 0;
    }

    if (_registered_class)
    {
        UnregisterClassW(PREVIEW_WINDOW_CLASSNAME, getInstanceHandle());
        _registered_class = 0;
    }

    _frame_width = 0;
    _frame_height = 0;
    _num_loops = 0;
    _frame_bitmaps.clear();
    _frame_delays.clear();
    _loop_time = std::chrono::milliseconds(0);

    _play_state = PS_STOP;
    _play_start_time = std::chrono::time_point<std::chrono::high_resolution_clock>();
    _current_frame = -1;
}
	void CWindowsApp::Run(IGameState *gameState)
	{
		ShowWindow(m_windowHandle, SW_SHOWDEFAULT);
		UpdateWindow(m_windowHandle);

		CoreManager::GetInstance()->SetDevice(m_direct3DDevice, (float)m_width, (float)m_height);
		GameStateManager::GetInstance()->PushGameState(gameState);
		Input::GetInstance()->Init(m_windowHandle);

		{
			MSG msg;
			ZeroMemory(&msg, sizeof(msg));

			Time::GetInstance()->Init();
			while (msg.message != WM_QUIT)
			{
				while (PeekMessage(&msg, nullptr, 0U, 0U, PM_REMOVE))
				{
					TranslateMessage(&msg);
					DispatchMessage(&msg);
				}

				Time::GetInstance()->CalculateTime();
				Input::GetInstance()->Acquiring();
				CoreManager::GetInstance()->Loop();
			}

			//UnregisterClass(m_wndClassEx.lpszClassName, m_wndClassEx.hInstance);
			UnregisterClassW(m_wndClassEx.lpszClassName, m_wndClassEx.hInstance);
			FreeDevice();
		}

		GameStateManager::GetInstance()->ClearAllState();
		CoreManager::GetInstance()->RemoveDevice();
	}
Exemple #4
0
////////////////////////////////////////////////////////////
/// Close (destroy) the window.
////////////////////////////////////////////////////////////
void WindowClose()
{
    // Destroy the custom icon, if any
    if (WindowIcon)
        DestroyIcon(WindowIcon);

    if (!WindowCallback)
    {
        // Destroy the window
        if (WindowhWnd)
            DestroyWindow(WindowhWnd);

        // Unregister window class if we were the last window
		if (HasUnicodeSupport())
		{
			UnregisterClassW(WindowClassNameW, GetModuleHandle(NULL));
		}
		else
		{
			UnregisterClassA(WindowClassNameA, GetModuleHandle(NULL));
		}
    }
    else
    {
        // The window is external : remove the hook on its message callback
        SetWindowLongPtr(WindowhWnd, GWLP_WNDPROC, WindowCallback);
    }

	// Set window open state to false
	WindowIsOpened = false;

    // Destroy the event mutex
    MutexDestroy(&WindowEventMutex);
}
Exemple #5
0
void CD3DApp::DestroyD3DApp()
{
	g_uiWndWidth = 0;
	g_uiWndHeight = 0;
	m_wWndPosX = 0;
	m_wWndPosY = 0;
	m_bFullscreen = 0;
	m_liCountNum = 0;
	m_liLastCountNum = 0;
	m_bPaused = 1;

	m_hInst = 0; 
	g_hWnd = 0;
	g_uiWndWidth = 0;
	g_uiWndHeight = 0;

	ReleaseX(g_pSwapChain);
	ReleaseX(g_pD3DDevice);
	ReleaseX(m_pDinput);
	m_pKeyboard->Unacquire();
	ReleaseX(m_pKeyboard);
	m_pMouse->Unacquire();
	ReleaseX(m_pMouse);

	UnregisterClassW(m_szWndClassName, m_hInst);
	delete[] m_szWndClassName;
	m_szWndClassName = NULL;
	delete[] m_szWndTitleText;
	m_szWndTitleText = NULL;
}
static void destroy_test_window()
{
    DestroyWindow(hWnd1);
    UnregisterClassW(L"testClass", 0);
    UnhookWindowsHookEx(hMouseHookLL);
    UnhookWindowsHookEx(hMouseHook);
}
Exemple #7
0
MIRAPI int Unload(void)
{
	int i;

	for (i = SIZEOF(popupServices); i--; )
		DestroyServiceFunction(popupServices[i].handle);

	SrmmMenu_Unload();

	UnhookEvent(hOptionsInitialize);
	UnhookEvent(hModulesLoaded);
	UnhookEvent(hOkToExit);
	UnhookEvent(hEventStatusChanged);
	UnhookEvent(hIconsChanged);
	UnhookEvent(hFontsChanged);
	UnhookEvent(hTBLoaded);

	DestroyServiceFunction(hShowHistory);
	DestroyServiceFunction(hTogglePopup);
	DestroyServiceFunction(hGetStatus);
	DestroyServiceFunction(hSquareFad);

	DeleteObject(fonts.title);
	DeleteObject(fonts.clock);
	DeleteObject(fonts.text);
	DeleteObject(fonts.action);
	DeleteObject(fonts.actionHover);

	DeleteObject(hbmNoAvatar);

	FreeLibrary(hDwmapiDll);
	FreeLibrary(hUserDll);
	FreeLibrary(hMsimgDll);
//	FreeLibrary(hKernelDll);
	FreeLibrary(hGdiDll);

	if(PopUpOptions.SkinPack) mir_free(PopUpOptions.SkinPack);
	mir_free(PopUpOptions.Effect);

	OptAdv_UnregisterVfx();
	UnloadPopupThread();
	UnloadPopupWnd2();
	PopupHistoryUnload();

	UnregisterClass (MAKEINTATOM(g_wndClass.cPopupWnd2),hInst);
	UnregisterClassW(L"PopupEditBox",hInst);
	UnregisterClass (MAKEINTATOM(g_wndClass.cPopupMenuHostWnd),hInst);
	UnregisterClass (MAKEINTATOM(g_wndClass.cPopupThreadManagerWnd),hInst);
	UnregisterClass (MAKEINTATOM(g_wndClass.cPopupPreviewBoxWndclass),hInst);
	UnregisterClass (MAKEINTATOM(g_wndClass.cPopupPlusDlgBox),hInst);

	UnloadGDIPlus();

	UnloadActions();

	CloseHandle(hMainThread);

	return 0;
}
Exemple #8
0
//-------------------------------------------------------------------------------------------------
//      ウィンドウの終了処理.
//-------------------------------------------------------------------------------------------------
void App::TermWnd()
{
    if ( m_hInst != nullptr )
    { UnregisterClassW( ASDX_WND_CLASSNAME, m_hInst ); }

    m_hInst = nullptr;
    m_hWnd  = nullptr;
}
void Engine::FinalizeScreen()
{
    if (NULL == mScreenHandle)
        return;

    DestroyWindow(mScreenHandle);
    UnregisterClassW(mWindowClassName, GetModuleHandle(NULL));
}
/*--------------------------------------
 * Function: registerWindowClass()
 *------------------------------------*/
static void unregisterWindowClass(void) {
    wchar_t* class_name = wstrdup(ClassName);

    if (!UnregisterClassW(class_name, GetModuleHandleW(NULL)))
        warn("could not unregister window class");

    free(class_name);
}
Exemple #11
0
void
OSGLContext_win::destroyWGLData(OSGLContext_wgl_data* wglInfo)
{
    if (wglInfo->instance) {
        FreeLibrary(wglInfo->instance);
        wglInfo->instance = 0;
    }
    UnregisterClassW( NATRON_WNDCLASSNAME, GetModuleHandleW(NULL) );
}
Exemple #12
0
HRESULT WeaselIME::UnregisterUIClass()
{
	if (!UnregisterClassW(GetUIClassName(), GetModuleInstance()))
	{
		DWORD dwErr = GetLastError();
		return HRESULT_FROM_WIN32(dwErr);
	}
	return S_OK;
}
Exemple #13
0
	Window::~Window()
	{
		Release();
		// UnRegister window class
		if(!mClassName.empty() && !UnregisterClassW(mClassName.c_str(),hInstance))
		{
			Log::Error( "Window::~Window: Could Not Unregister Class." );
		}
	}
Exemple #14
0
static void hugsprim_UnregisterClassW_2(HugsStackPtr hugs_root)
{
    HsPtr arg1;
    HsPtr arg2;
    arg1 = hugs->getPtr();
    arg2 = hugs->getPtr();
    UnregisterClassW(arg1, arg2);
    
    hugs->returnIO(hugs_root,0);
}
Exemple #15
0
/*
** GLimp_Shutdown
**
** This routine does all OS specific shutdown procedures for the OpenGL
** subsystem.  Under OpenGL this means NULLing out the current DC and
** HGLRC, deleting the rendering context, and releasing the DC acquired
** for the window.  The state structure is also nulled out.
**
*/
void GLimp_Shutdown( void )
{
	if( qwglMakeCurrent && !qwglMakeCurrent( NULL, NULL ) )
		ri.Com_Printf( "ref_gl::R_Shutdown() - wglMakeCurrent failed\n" );
	if( glw_state.hGLRC )
	{
		if( qwglDeleteContext && !qwglDeleteContext( glw_state.hGLRC ) )
			ri.Com_Printf( "ref_gl::R_Shutdown() - wglDeleteContext failed\n" );
		glw_state.hGLRC = NULL;
	}
	if( glw_state.hDC )
	{
		if( !ReleaseDC( glw_state.hWnd, glw_state.hDC ) )
			ri.Com_Printf( "ref_gl::R_Shutdown() - ReleaseDC failed\n" );
		glw_state.hDC   = NULL;
	}
	if( glw_state.hWnd )
	{
		ShowWindow( glw_state.hWnd, SW_HIDE );
		DestroyWindow( glw_state.hWnd );
		glw_state.hWnd = NULL;
	}

#ifdef WITH_UTF8
	UnregisterClassW( glw_state.windowClassNameW, glw_state.hInstance );
#else
	UnregisterClass( glw_state.windowClassName, glw_state.hInstance );
#endif

	if( glConfig.fullScreen )
	{
		ChangeDisplaySettings( 0, 0 );
		glConfig.fullScreen = false;
	}

	if( glw_state.applicationName )
	{
		free( glw_state.applicationName );
		glw_state.applicationName = NULL;
	}

	if( glw_state.applicationNameW )
	{
		free( glw_state.applicationNameW );
		glw_state.applicationNameW = NULL;
	}

	glw_state.applicationIconResourceID = 0;

	glw_state.win_x = 0;
	glw_state.win_y = 0;

	glConfig.width = 0;
	glConfig.height = 0;
}
Exemple #16
0
Window::~Window()
{
	// Destroy the window
	DestroyWindow(m_HWnd);

	// If this was the last window, unregister the window class
	if (--WndCount == 0)
	{
		UnregisterClassW(Window::WndClassname.c_str(), GetModuleHandleW(nullptr));
	}
}
Exemple #17
0
Win32Assistant::~Win32Assistant ()
{
  //SetConsoleOutputCP (oldCP);
  if (!is_console_app && (console_window || cmdline_help_wanted))
    FreeConsole();
  if (cswinIsWinNT ())
    UnregisterClassW ((WCHAR*)windowClass, ModuleHandle);
  else
    UnregisterClassA ((char*)windowClass, ModuleHandle); 
  delete[] windowClass;
}
Exemple #18
0
/**
 * \brief Uninitialize w32_common framework.
 *
 * Should be called last in video driver's uninit function. First release
 * anything built on top of the created window e.g. rendering context inside
 * and call vo_w32_uninit at the end.
 */
void vo_w32_uninit(struct vo *vo)
{
    struct vo_w32_state *w32 = vo->w32;
    MP_VERBOSE(vo, "win32: uninit\n");
    if (!w32)
        return;
    SetThreadExecutionState(ES_CONTINUOUS);
    DestroyWindow(w32->window);
    UnregisterClassW(classname, 0);
    talloc_free(w32);
    vo->w32 = NULL;
}
Exemple #19
0
bool StWinHandles::unregisterClass(StStringUtfWide& theName) {
    HMODULE aModule = GetModuleHandleW(NULL);
    if(!theName.isEmpty()) {
        if(UnregisterClassW(theName.toCString(), aModule) == 0) {
            ST_DEBUG_LOG("WinAPI, FAILED to unregister Class= '" + theName.toUtf8() + "'");
            return false;
        }
        ST_DEBUG_LOG("WinAPI, Unregistered Class= " + theName.toUtf8());
        theName.clear();
    }
    return true;
}
Exemple #20
0
		DummyWindow::~DummyWindow()
		{
			if(!DestroyWindow(hwnd))
			{
				std::cerr << "Can't destroy window" << win32::getErrorMsg() << std::endl;
			}

			if(!UnregisterClassW(reinterpret_cast<LPCWSTR>(classatom), hinstance))
			{
				std::cerr << "Can't unregister win32 window class: " << win32::getErrorMsg();
			}
		}
Exemple #21
0
/**
 * \brief Uninitialize w32_common framework.
 *
 * Should be called last in video driver's uninit function. First release
 * anything built on top of the created window e.g. rendering context inside
 * and call vo_w32_uninit at the end.
 */
void vo_w32_uninit(struct vo *vo)
{
    struct vo_w32_state *w32 = vo->w32;
    mp_msg(MSGT_VO, MSGL_V, "vo: win32: uninit\n");
    if (!w32)
        return;
    ShowCursor(1);
    DestroyWindow(w32->window);
    UnregisterClassW(classname, 0);
    talloc_free(w32);
    vo->w32 = NULL;
}
Exemple #22
0
//Unregisters, releases the DC if needed, and destroys the window.
void WinDestroy()
{
    if ((WindowDC != NULL) && (ReleaseDC(WindowHandle, WindowDC) == 0)){
        WindowDC = 0;
    }
    if ((!WindowHandle == 0) && (!(DestroyWindow(WindowHandle)))){
        WindowHandle = 0;
    }
    if (!(UnregisterClassW(szWindowClass, WindowINST))){
        WindowINST = 0;
    }
};
Exemple #23
0
void CCFader::Destroy()
{
    DeleteObject(this->hBackground);
    DeleteObject(this->hCenterLine);
    DeleteObject(this->hFader);
    DeleteObject(this->hSlit);
    DeleteObject(this->hTickMarks);

	DestroyWindow(this->hWnd);
	UnregisterClassW(this->sClass, this->hInstance);
    this->hWnd = 0;
}
QEventDispatcherWin32Private::~QEventDispatcherWin32Private()
{
    wakeUpNotifier.setEnabled(false);
    CloseHandle(wakeUpNotifier.handle());
    if (internalHwnd)
        DestroyWindow(internalHwnd);
    QByteArray className = "QEventDispatcherWin32_Internal_Widget" + QByteArray::number(quintptr(qt_internal_proc));
#if !defined(Q_OS_WINCE)
    UnregisterClassA(className.constData(), qWinAppInst());
#else
	UnregisterClassW(reinterpret_cast<const wchar_t *> (QString::fromLatin1(className.constData()).utf16()), qWinAppInst());
#endif
}
Exemple #25
0
static
VOID
UninitializeSAS(
    IN OUT PWLSESSION Session)
{
    if (Session->SASWindow)
    {
        DestroyWindow(Session->SASWindow);
        Session->SASWindow = NULL;
    }
    if (Session->hEndOfScreenSaverThread)
        SetEvent(Session->hEndOfScreenSaverThread);
    UnregisterClassW(WINLOGON_SAS_CLASS, hAppInstance);
}
Exemple #26
0
/** @callback_method_impl{FNRTTHREAD,
 *      Thread that creates service a window the DIFx can destroy, thereby
 *      triggering process termination. }
 */
static DECLCALLBACK(int) DIFxKillableProcessThreadProc(RTTHREAD hThreadSelf, void *pvUser)
{
    RT_NOREF(hThreadSelf, pvUser);
    HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(NULL);

    /* Register the Window Class. */
    WNDCLASSW WndCls;
    WndCls.style         = 0;
    WndCls.lpfnWndProc   = DIFxKillableWindowProc;
    WndCls.cbClsExtra    = 0;
    WndCls.cbWndExtra    = sizeof(void *);
    WndCls.hInstance     = hInstance;
    WndCls.hIcon         = NULL;
    WndCls.hCursor       = NULL;
    WndCls.hbrBackground = (HBRUSH)(COLOR_BACKGROUND + 1);
    WndCls.lpszMenuName  = NULL;
    WndCls.lpszClassName = g_wszWndClassName;

    ATOM atomWindowClass = RegisterClassW(&WndCls);
    if (atomWindowClass != 0)
    {
        /* Create the window. */
        HWND hwnd = CreateWindowExW(WS_EX_TOOLWINDOW | WS_EX_TRANSPARENT | WS_EX_TOPMOST,
                                    g_wszWndClassName, g_wszWndClassName,
                                    WS_POPUPWINDOW,
                                    -200, -200, 100, 100, NULL, NULL, hInstance, NULL);
        if (hwnd)
        {
            SetWindowPos(hwnd, HWND_TOPMOST, -200, -200, 0, 0,
                         SWP_NOACTIVATE | SWP_HIDEWINDOW | SWP_NOCOPYBITS | SWP_NOREDRAW | SWP_NOSIZE);

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

            DestroyWindow(hwnd);
        }

        UnregisterClassW(g_wszWndClassName, hInstance);

        if (hwnd && g_fExitProcessOnQuit)
            exit(0);
    }
    return 0;
}
Exemple #27
0
void GamePlayer::___exit()
{
	if (hRgssCore)
	{
		FreeLibrary(hRgssCore);
		hRgssCore = NULL;
	}

	if (g_hWnd)
	{
		DestroyWindow(g_hWnd);
		g_hWnd = NULL;
	}

	UnregisterClassW(pWndClassName, hInstance);
}
Exemple #28
0
	void Window::Destroy()
	{
		if (m_hWnd)
		{
			DestroyWindow(m_hWnd);
			m_hWnd = nullptr;

			UnregisterClassW(m_appName.c_str(), GetModuleHandle(nullptr));
			
			m_appName = L"";
			m_width = 0;
			m_height = 0;
		}

		SK_ENSURE(!IsCreated());
	}
void CCEGLView::end()
{
    if (m_hWnd)
    {
#if(_MSC_VER >= 1600)
        if(m_bSupportTouch)
		{
		    s_pfUnregisterTouchWindowFunction(m_hWnd);
		}
#endif /* #if(_MSC_VER >= 1600) */
        DestroyWindow(m_hWnd);
        m_hWnd = NULL;
    }
    s_pMainWindow = NULL;
    UnregisterClassW(kWindowClassName, GetModuleHandle(NULL));
    delete this;
}
Exemple #30
0
		DummyWindow::DummyWindow(HINSTANCE hinstance)
		{
			this->hinstance = hinstance;

			WCHAR classname[sizeof(DummyWindow*) * 2 + 1];
			win32::genClassNameStr(this, classname);

			WNDCLASSEXW klass;
			klass.cbSize = sizeof(WNDCLASSEXW);
			klass.style = CS_OWNDC;
			klass.lpfnWndProc = &wndproc;
			klass.cbClsExtra = 0;
			klass.cbWndExtra = 0;
			klass.hInstance = hinstance;
			klass.hIcon = 0;
			klass.hCursor = 0;
			klass.hbrBackground = 0;
			klass.lpszMenuName = 0;
			klass.lpszClassName = &classname[0];
			klass.hIconSm = 0;

			classatom = RegisterClassExW(&klass);
			if(!classatom)
				throw Exception("Can't register win32 window class: " + win32::getErrorMsg());

			hwnd = CreateWindowExW(
				0,
				&classname[0],
				L"",	// window title
				WS_POPUP | WS_DISABLED,
				CW_USEDEFAULT, CW_USEDEFAULT,
				100, 100, // width, height
				0,
				0,
				hinstance,
				0);

			if(!hwnd)
			{
				DWORD err = GetLastError();
				UnregisterClassW(&classname[0], hinstance);
				throw wm::Exception("Can't create Window: " + wm::win32::getErrorMsg(err));
			}
		}