-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
201 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include "stdafx.h" | ||
#include "ActiveExeAction.h" | ||
#include "ActionMonitor.h" | ||
|
||
/** | ||
* The Default active contructor | ||
* @param const Action& src the action that is now active. | ||
* @param HWND hTopHWnd the window that was on top at the time the command was given. | ||
* @param const MYODD_STRING& szCommandLine the given command line that is, the words after the command itself | ||
* @param bool isPrivileged if this action is privileged or not. | ||
*/ | ||
ActiveExeAction::ActiveExeAction(const Action& src, HWND hTopHWnd, const MYODD_STRING& szCommandLine, bool isPrivileged) : | ||
ActiveAction( src, hTopHWnd, szCommandLine, isPrivileged ) | ||
{ | ||
} | ||
|
||
ActiveExeAction::~ActiveExeAction() | ||
{ | ||
} | ||
|
||
bool ActiveExeAction::OnDeInitialize() | ||
{ | ||
// nothing to do. | ||
return true; | ||
} | ||
|
||
bool ActiveExeAction::OnInitialize() | ||
{ | ||
// all good | ||
return true; | ||
} | ||
|
||
void ActiveExeAction::OnExecuteInThread() | ||
{ | ||
auto szFile = File(); | ||
auto szExt = myodd::files::GetExtension( szFile );; | ||
auto szCommand = Command(); | ||
|
||
// we just launch the exe by itself. | ||
std::vector<MYODD_STRING> argv; | ||
argv.push_back( szFile); | ||
Execute(argv, IsPrivileged(), nullptr ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#pragma once | ||
#include "ActiveAction.h" | ||
|
||
class ActiveExeAction : | ||
public ActiveAction | ||
{ | ||
public: | ||
ActiveExeAction(const Action& src, HWND hTopHWnd, const MYODD_STRING& szCommandLine, bool isPrivileged); | ||
virtual ~ActiveExeAction(); | ||
|
||
protected: | ||
virtual bool OnInitialize(); | ||
virtual bool OnDeInitialize(); | ||
virtual void OnExecuteInThread(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters