Exemplo n.º 1
0
void ChromeAction::FinishExecution(ExecutionProcess process)
{
    if (_getProcessIDs(process.GetName()).size() > 0)
    {
        Runner runner;
        runner.RequestCloseToProcessID(_getProcessIDs(process.GetName()).at(0), true);
    }
}
void AdobeReaderAction::FinishExecution(ExecutionProcess process)
{	
	Runner runner;
	vector <DWORD> processIDs = _getProcessIDs(process.GetName());

	if (_getMajorVersion() == 9)
	{
		if (processIDs.size() > 0)
		{
			OSVersion version;

			if (version.GetVersion() == WindowsXP)
			{
				runner.TerminateProcessID(processIDs.at(0));
			}
			else // Windows Vista, 7 or better
			{
				runner.RequestCloseToProcessID(processIDs.at(0), false);
			}
		}
	}
	else
	{
		for (unsigned int i = 0; i < processIDs.size(); i++)
		{
			runner.RequestQuitToProcessID(processIDs.at(i));
		}
	}
}
void FirefoxAction::FinishExecution(ExecutionProcess process)
{
	vector <DWORD> processIDs = _getProcessIDs(process.GetName());

	if (processIDs.size() > 0)
	{
		Runner runner;
		runner.RequestCloseToProcessID(processIDs.at(0), true);
	}
}
ExecutionProcess OpenOfficeAction::GetExecutingProcess()
{
	ExecutionProcess process;

	process = ActionExecution::GetExecutingProcess();

	if (process.IsEmpty() == false)
	{
		return process;
	}

	if (FindWindowEx(NULL, NULL, LISTENER_WINDOWCLASS, NULL) == NULL)
	{
		return ExecutionProcess();
	}
	else
	{
		return ExecutionProcess(KILLTRAY_MESSAGE, L"", true);
	}
}