-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbluestacks_auto_fullscreen.cpp
54 lines (45 loc) · 1.65 KB
/
bluestacks_auto_fullscreen.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <windows.h>
int main()
{
// NEVER QUOTE lpApplicationName IT SCREWS UP PARSING RESULTING IN ACESS_DENIED (ERR5)
LPCSTR app = "C:\\Program Files\\BlueStacks\\Bluestacks.exe";
STARTUPINFO si;
PROCESS_INFORMATION pi;
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
memset(&pi, 0, sizeof(pi));
// Create Process ============================================================================
BOOL res = CreateProcess(
app, // [I|O] Name of the module to be executed, that's it
NULL, // [IO|O] Command line to be exectued, searches PATH, adds extention
NULL, // [I|O] Sec. Attrib. for inhereting new process by child processes
NULL, // [I|O] Sec. Attrib. for inhereting new thread by child processes
FALSE, // [I] New proc. inherits each inheritable handle
NULL, // [I] Process creation flags
NULL, // [I|O] Ptr to environment block of new process (inherit if NULL)
NULL, // [I|O] Full path to current directory for the process
&si, // [I] Ptr to STARTUPINFO struct, if dwFlags = 0, def. values used
&pi // [O] Ptr to PROCESS_INFORMATION struct with new proc identification info
);
// ===========================================================================================
if(res)
{
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
Sleep(14000);
}
else
{
return -1;
}
INPUT inps[2];
memset(&inps, 0, sizeof(inps));
inps[0].type = INPUT_KEYBOARD;
inps[0].ki.wScan = 0x57; // F11
inps[0].ki.dwFlags = KEYEVENTF_SCANCODE;
inps[1].type = INPUT_KEYBOARD;
inps[1].ki.wScan = 0x57; // F11
inps[1].ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
SendInput(4, inps, sizeof(INPUT));
return 0;
}