示例#1
0
/*****************************************************************************
 * UnregisterAsioDriver()
 *****************************************************************************
 */
HRESULT 
UnregisterAsioDriver
(
	IN		LPTSTR	FriendlyName,
    IN      REFGUID ClassId
)
{
	HKEY AsioPublicKey = NULL;

	DWORD w32Error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, ASIO_PUBLIC_KEY, 0, KEY_ALL_ACCESS, &AsioPublicKey);

	if (ERROR_SUCCESS == w32Error)
	{
		RegDeleteKey(AsioPublicKey, FriendlyName);

		RegCloseKey(AsioPublicKey);
	}

    if (ERROR_SUCCESS == w32Error)
    {
        return UnregisterInprocServer(ClassId);
    }
    else
    {
        return E_FAIL;
    }
}
示例#2
0
// DllUnregisterServer - Removes entries from the system registry
STDAPI DllUnregisterServer(void)
{
	m_ac.disconnectFromServer();
    HRESULT hr = S_OK;

    wchar_t szModule[MAX_PATH];
    if (GetModuleFileName(g_hInst, szModule, ARRAYSIZE(szModule)) == 0)
    {
        hr = HRESULT_FROM_WIN32(GetLastError());
        return hr;
    }

    // Unregister the component.
    hr = UnregisterInprocServer(CLSID_DDShellExt);
    if (SUCCEEDED(hr))
    {
        // Unregister the context menu handler.
        hr = UnregisterShellExtContextMenuHandler(L"textfile", CLSID_DDShellExt);
		hr = UnregisterShellExtContextMenuHandler(L"Drive", CLSID_DDShellExt);
		hr = UnregisterShellExtContextMenuHandler(L"Directory", CLSID_DDShellExt);
		hr = UnregisterShellExtContextMenuHandler(L"Folder", CLSID_DDShellExt);
		return hr;
    }
	return S_OK;
}
示例#3
0
STDAPI DllUnregisterServer(void)
{
    HRESULT hr = S_OK;

    wchar_t szModule[MAX_PATH];
    if (GetModuleFileName(g_hInst, szModule, ARRAYSIZE(szModule)) == 0)
    {
        hr = HRESULT_FROM_WIN32(GetLastError());
        return hr;
    }

    hr = UnregisterInprocServer(CLSID_ContextMenuExt);
    if (SUCCEEDED(hr))
    {
        hr = UnregisterShellExtContextMenuHandler(L"*", 
            CLSID_ContextMenuExt);
    }

    return hr;
}