static void RunSearch()
{
	// getting search provider 
	wchar_t searchProvider[500] = {0};
	RegistryGetString(HKEY_CURRENT_USER, L"Software\\Microsoft\\Internet Explorer\\SearchProviders", L"DefaultProvider", searchProvider, 500);
	if (wcslen(searchProvider) > 0)
	{
		wchar_t fullKeyName[500];
		wcscpy_s(fullKeyName, 500, L"Software\\Microsoft\\Internet Explorer\\SearchProviders\\");
		wcscat_s(fullKeyName, 500, searchProvider);
		wchar_t searchUrl[500] = {0};

		RegistryGetString(HKEY_CURRENT_USER, fullKeyName, L"Url", searchUrl, 500);

		if (wcslen(searchUrl) > 0)
		{
			wchar_t *pSearchUrl = searchUrl;
			if (wcsrchr(pSearchUrl, L'{'))
				*wcsrchr(pSearchUrl, L'{') = L'\0';
			wchar_t appUri[500];

			wcscpy_s(appUri, 500, L"app://5B04B775-356B-4AA0-AAF8-6491FFEA5660/_default?StartURL=");
			wcscat_s(appUri, 500, pSearchUrl);
			Shell::Tasks::StartSession(appUri);
		}
	}
	else
	{
		// running bing
		wchar_t appUri[500];
		wcscpy_s(appUri, 500, L"app://5B04B775-356B-4AA0-AAF8-6491FFEA5660/_default?StartURL=");
		wcscat_s(appUri, 500, L"http://m.bing.com");
		Shell::Tasks::StartSession(appUri);
	}
}
void ViewerWindowBase::SetupFontFromRegistry(void)
{
    // get font info from registry, and create wxFont
    string nativeFont;
    RegistryGetString(REG_SEQUENCE_FONT_SECTION, REG_FONT_NATIVE_FONT_INFO, &nativeFont);
    auto_ptr<wxFont> font(wxFont::New(wxString(nativeFont.c_str())));
    if (!font.get() || !font->Ok())
    {
        ERRORMSG("ViewerWindowBase::SetupFontFromRegistry() - error setting up font");
        return;
    }
    viewerWidget->SetCharacterFont(font.release());
}
static void RunBrowserUrl()
{
	// getting url
	wchar_t url[500] = {0};
	RegistryGetString(HKEY_LOCAL_MACHINE, L"Software\\OEM\\WebSearchOverride", L"Url", url, 500);
	if (wcslen(url) > 0)
	{
		wchar_t appUri[500];
		wcscpy_s(appUri, 500, L"app://5B04B775-356B-4AA0-AAF8-6491FFEA5660/_default?StartURL=");
		wcscat_s(appUri, 500, url);
		Shell::Tasks::StartSession(appUri);
	}
}
Example #4
0
VOID ThemeLoader_LoadNormalImage()
{
	wchar_t registryPath[512];
	if (RegistryGetString(UTASK_THEMETOOLBAR_REG_BRANCH, 
						UTASK_THEMETOOLBAR_REG_KEY, UTASK_THEMETOOLBAR_REG_NORMAL, 
						registryPath, 512) == S_OK)
	{
		hBackground = LoadTransparentImage(registryPath);
		if (hBackground)
			GetObject(hBackground, sizeof (bmpBackground), &bmpBackground);
	}
	else
		hBackground = NULL;
};
Example #5
0
VOID ThemeLoader_LoadSelectedImage()
{
	wchar_t registryPath[512];
	if (RegistryGetString(UTASK_THEMETOOLBAR_REG_BRANCH, 
						UTASK_THEMETOOLBAR_REG_KEY, UTASK_THEMETOOLBAR_REG_SELECTED, 
						registryPath, 512) == S_OK)
	{
		hBackground_Selected = LoadTransparentImage(registryPath);
		if (hBackground_Selected)
			GetObject(hBackground_Selected, sizeof (bmpBackground_Selected), &bmpBackground_Selected);
	}
	else
	{
		hBackground_Selected = NULL;
	}
};
Example #6
0
void CQuickLaunch::LoadLaunchItems(HKEY hKey, list<LaunchItem*>* pLaunchItems)
{
	DWORD dwCount = 0;
	RegistryGetDWORD(hKey, NULL, L"Count", &dwCount);

	for (DWORD i = 0; i < dwCount; ++i)
	{
		WCHAR wzPath[10],wzCount[5];
		DWORD dwSize = 0;
		_itow(i, wzCount, 10);

		StringCchCopy(wzPath, ARRAYSIZE(wzPath), wzCount);
		StringCchCat(wzPath, ARRAYSIZE(wzPath), L"_Path");

		LaunchItem* pRecord = new LaunchItem();
		
		bool bDelete = true;

		if (ERROR_SUCCESS == RegistryGetString(hKey, NULL, wzPath, pRecord->wzPath, ARRAYSIZE(pRecord->wzPath)))
		{
			pRecord->hIcon = GetApplicationIcon(pRecord->wzPath, false, NULL, NULL, NULL);
			
			// TODO: Load default icon
			if (!pRecord->hIcon)
			{
				pRecord->hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_ICON1));
			}
			bDelete = false;
		}
		if (bDelete)
		{
			delete pRecord;
		}
		else
		{
			pLaunchItems->push_back(pRecord);
		}
	}
}
bool ProcessAction()
{
	DWORD dwAction = Dynamics::SearchKeyAction::ACTION_BING;
	RegistryGetDWORD(HKEY_LOCAL_MACHINE, L"Software\\OEM\\WebSearchOverride", L"ActionType", &dwAction);

	bool processed = true;
	if (Dynamics::SearchKey::IsValidHash() == FALSE || Dynamics::SearchKey::IsSearchKeySettingsXapPresent() == false)
		return false;
	switch (dwAction)
	{
	case Dynamics::SearchKeyAction::ACTION_NO:
		{
			break;
		}
	case Dynamics::SearchKeyAction::ACTION_BING:
		{
			RunBing(NULL);
			break;
		}
	case Dynamics::SearchKeyAction::ACTION_SEARCH:
		{
			RunSearch();
			break;
		}
	case Dynamics::SearchKeyAction::ACTION_RUNAPPLICATION:
		{
			wchar_t appUri[500] = {0};
			RegistryGetString(HKEY_LOCAL_MACHINE, L"Software\\OEM\\WebSearchOverride", L"Uri", appUri, 500);
			Shell::Tasks::StartSession(appUri);
			break;
		}
	case Dynamics::SearchKeyAction::ACTION_EXE:
		{
			wchar_t exePath[500] = {0};
			RegistryGetString(HKEY_LOCAL_MACHINE, L"Software\\OEM\\WebSearchOverride", L"ExePath", exePath, 500);

			wchar_t exeArgs[500] = {0};
			RegistryGetString(HKEY_LOCAL_MACHINE, L"Software\\OEM\\WebSearchOverride", L"ExeArgs", exeArgs, 500);

			Diagnostics::Process::Start(exePath, exeArgs, NULL, true);
			break;
		}
	case Dynamics::SearchKeyAction::ACTION_URL:
		{
			RunBrowserUrl();
			break;
		}
	case Dynamics::SearchKeyAction::ACTION_KEYEVENT:
		{
			DWORD dwKeyCode = 0;
			RegistryGetDWORD(HKEY_LOCAL_MACHINE, L"Software\\OEM\\WebSearchOverride", L"KeyCode", &dwKeyCode);
			if (dwKeyCode != 0)
			{
				keybd_event(dwKeyCode, 0, KEYEVENTF_SILENT, 0);
				Sleep(100);
				keybd_event(dwKeyCode, 0, KEYEVENTF_SILENT | KEYEVENTF_KEYUP, 0);
			}
			break;
		}
	default:
		processed = false;
		break;
	}
	return processed;
}
Example #8
0
	BOOL ShowApplet(HWND hWnd, LONG_PTR /*lData*/, LPCTSTR pstrCommand)
	{
		BOOL bWithFingerMenu = FALSE;
		CString szPath;
		CString szProgramFilesFolder;
		WCHAR szInstallDir[MAX_PATH];
		WCHAR szValue[MAX_PATH];
		ZeroMemory(szValue, sizeof(szValue));
		if (SHGetSpecialFolderPath(NULL, szValue, CSIDL_PROGRAM_FILES, FALSE))
		{
			szProgramFilesFolder.Format(L"%s", szValue);
		}
		if (RegistryGetString(HKEY_LOCAL_MACHINE, L"Software\\FingerMenu", L"InstallDir", szInstallDir, MAX_PATH) == S_OK)
		{
			szPath.Format(L"%s\\FingerMenu.exe", szInstallDir);
		}
		else
		{
			szPath = szProgramFilesFolder + L"\\FingerMenu\\FingerMenu.exe";
		}
		
		CFindFile finder; 
		if (finder.FindFile(szPath))
		{
			bWithFingerMenu = TRUE;
		}



		dlg1.SetTitle(L"Startup");
		dlg1.m_bWithFingerMenu = bWithFingerMenu;
		if (bWithFingerMenu)
		{
			dlg2.SetTitle(L"Menu options");
			dlg3.SetTitle(L"Menu exclusions");
			dlg7.SetTitle(L"Menu wnd exclusions");
		}
		dlg5.SetTitle(L"Msgbox options");
		dlg6.SetTitle(L"Msgbox exclusions");
		dlg8.SetTitle(L"Msgbox wnd exclusions");
		dlg4.SetTitle(L"Skins");
		dlg4.m_bWithFingerMenu = bWithFingerMenu;
		dlgAbout.SetTitle(L"About");

		// about box
		CString strCredits = "\n\n"
			    "\tFingerMenu v1.12\n\n"
				"\tFingerMsgBox v1.01\n\n"
				"\rdeveloped by:\n"
				"Francesco Carlucci\n"
				"<*****@*****.**>\n"
				"\n\n"
				"http://forum.xda-developers.com/\n"
				"                showthread.php?t=459125\n";

		dlgAbout.SetCredits(strCredits);

		CPropertySheet sheet;
		sheet.AddPage(dlg1);
		if (bWithFingerMenu)
		{
			sheet.AddPage(dlg2);
			sheet.AddPage(dlg3);
			sheet.AddPage(dlg7);
		}
		sheet.AddPage(dlg5);
		sheet.AddPage(dlg6);
		sheet.AddPage(dlg8);
		sheet.AddPage(dlg4);
		sheet.AddPage(dlgAbout);
		sheet.SetActivePage(_ttol(pstrCommand));
		if (IDOK == sheet.DoModal(hWnd))
		{
			ReloadConfiguration();
		}

		return TRUE;
	}