Created
May 30, 2017 09:02
-
-
Save myfreeer/10e8d73f2ab4bcf469a66996da94d150 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#define UNICODE | |
#define _UNICODE | |
#include <windows.h> | |
//main entry | |
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd) { | |
const int cmdLineLength = lstrlenW(lpCmdLine); | |
if (cmdLineLength == 0) { | |
return 1; | |
} | |
for (int i = 0; i < cmdLineLength; i++) { | |
SendMessageW(GetForegroundWindow(), WM_CHAR, lpCmdLine[i], 0); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment