Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // First register whatever hotkey you want,
- // then get the hWnd for ET and save to hWndET,
- // then run the below code whenever the hotkey is pressed.
- // If you use same resolution in game and on desktop,
- // comment everything except the ShowWindow-functions
- WINDOWPLACEMENT ETwp;
- GetWindowPlacement(hWndET, &ETwp);
- if (ETwp.showCmd == SW_SHOWMINIMIZED) {
- ShowWindow(hWndET, SW_RESTORE);
- HWND hWndETCon = FindWindowExA(FindWindow(0, "ET Console"), NULL, "Edit", 0);
- SendMessage(hWndETCon, WM_SETTEXT, 0, (LPARAM) "vid_restart");
- SendMessage(hWndETCon, WM_CHAR, 13, 0);
- } else {
- ShowWindow(hWndET, SW_MINIMIZE);
- ChangeDisplaySettings(NULL,0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement