Esempio n. 1
0
void CSettings::Uninstall() {
	BOOL b;
	if (IsVista() && IsElevated(&b) != S_OK) {
		RunIuElevated("/uninstall");
		return;
	}
	AutoStartup = false;
	SendToContextMenu  = false;
	RegisterShellExtension(false);
	EnableAutostartup(false);
	CRegistry Reg;
	Reg.SetRootKey(HKEY_CURRENT_USER);
	Reg.DeleteWithSubkeys("Software\\Zenden.ws\\Image Uploader\\ContextMenuItems");
	Reg.DeleteKey( "Software\\Zenden.ws\\Image Uploader" );
	Reg.DeleteKey( "Software\\Zenden.ws" ); // Will not delete if contains subkeys
	Reg.SetRootKey( HKEY_LOCAL_MACHINE );
	Reg.DeleteKey( "Software\\Zenden.ws\\Image Uploader" );
	Reg.DeleteKey( "Software\\Zenden.ws" ); // Will not delete if contains subkeys
	WinUtils::RemoveBrowserKey();

	CString ShortcutName = GetSendToPath() + _T("\\Image Uploader.lnk");
	DeleteFile(ShortcutName);
}
Esempio n. 2
0
void PropShell::OnUnregisterShellExtension()
{
	RegisterShellExtension(true);
}
Esempio n. 3
0
// The following code should  be deleted in next releases
	void CSettings::ApplyRegSettingsRightNow()
	{
		// Applying Startup settings
		// EnableAutostartup(AutoStartup);
		RegisterShellExtension( ExplorerContextMenu );

		// if(SendToContextMenu_changed)
		{
			CString ShortcutName = GetSendToPath() + _T("\\Image Uploader.lnk");

			if (SendToContextMenu )
			{
				if (FileExists(ShortcutName))
					DeleteFile(ShortcutName);

				CreateShortCut(ShortcutName, CmdLine.ModuleName(), WinUtils::GetAppFolder(), _T(
				                  " /upload"), 0, SW_SHOW, CmdLine.ModuleName(), 0);
			}
			else
			{
				DeleteFile(ShortcutName);
			}
		}

		// if(ExplorerImagesContextMenu_changed || ExplorerVideoContextMenu_changed)
		{
			TCHAR szFileName[MAX_PATH + 8] = _T("\"");

			GetModuleFileName(0, szFileName + 1, MAX_PATH);
			lstrcat(szFileName, _T("\" \"%1\""));

			LPTSTR szList = _T("jpg\0jpeg\0png\0bmp\0gif");
			int Res;

			UnRegisterClsId();

			// if(ExplorerContextMenu_changed)
			{
				while ((*szList) != 0)
				{
					Res =
					   AddToExplorerContextMenu(szList, (/*ExplorerImagesContextMenu?TR("Загрузить изображения"):*/ 0),
					                            szFileName,
					                            true);
					szList += lstrlen(szList) + 1;
				}
			}

			// if( ExplorerVideoContextMenu_changed)
			{
				szList = VIDEO_FORMATS;
				while ((*szList) != 0)
				{
					Res =
					   AddToExplorerContextMenu(szList, (/*ExplorerVideoContextMenu?TR("Открыть в Image Uploader"):*/ 0),
					                            szFileName,
					                            false);
					szList += lstrlen(szList) + 1;
				}
			}
		}
	}
Esempio n. 4
0
void PropShell::OnRegisterShellExtension()
{
	RegisterShellExtension(false);
}