Я просто написал программу, чтобы сделать это сам.
Base64-кодированная версия моего исполняемого файла:
TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyAAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1vZGUuDQ0KJAAAAAAAAADJCgP2jWttpY1rbaWNa22lTmQwpYhrbaWNa2ylgWttpU5kCaWMa22lTmQ3pYxrbaVSaWNojWttpQAAAAAAAAAAAAAAAAAAAABQRQAATAECAIysUU4AAAAAAAAAAOAADwELAQcKAAQAAAACAAAAAAAAqREAAAAQAAAAIAAAAABAAAAQAAAAAgAABAAAAAAAAAAEAAAAAAAAAAAwAAAABAAAAAAAAAIAAAQAABAAABAAAAAAEAAAEAAAAAAAABAAAAAAAAAAAAAAAAwSAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC50ZXh0AAAAbgMAAAAQAAAABAAAAAQAAAAAAAAAAAAAAAAAACAAAGAuZGF0YQAAAAQAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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SBIAAAAAAAAAAAAAlBIAAAAQAABQEgAAAAAAAAAAAABiEwAACBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgBIAAAAAAACiEgAAthIAAMYSAADaEgAA6hIAAP4SAAASEwAAJBMAADITAABCEwAAVBMAAAAAAAB4AUdldE1vZHVsZUhhbmRsZVcAAEtFUk5FTDMyLmRsbAAApABEaXNwYXRjaE1lc3NhZ2VXAABCAlNlbmRNZXNzYWdlVwAAjQJTZXRXaW5kb3dzSG9va0V4VwDnAEZpbmRXaW5kb3dFeFcAEAFHZXREZXNrdG9wV2luZG93AACsAlRyYW5zbGF0ZU1lc3NhZ2UAABoAQ2FsbE5leHRIb29rRXgAACMBR2V0S2V5U3RhdGUAAgJQb3N0TWVzc2FnZVcAAAMCUG9zdFF1aXRNZXNzYWdlAEABR2V0TWVzc2FnZVcAVVNFUjMyLmRsbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
Исходный код:
//Flags: /O1 /link /NoDefaultLib /entry:WinMainCRTStartup /Subsystem:Windows //No need for a C runtime library... #define _WIN32_WINNT 0x502 #include <tchar.h> #include <windows.h> #include <commctrl.h> static HHOOK hHook = NULL; LRESULT CALLBACK KeyboardHook(IN int nCode, IN WPARAM wParam, IN LPARAM lParam) { BOOL suppress = FALSE; LPKBDLLHOOKSTRUCT pKBDHS = (LPKBDLLHOOKSTRUCT)lParam; int nKey = pKBDHS->vkCode - 0x30; if (nCode >= 0 && wParam == WM_KEYDOWN && 0 <= nKey && nKey <= 9) { if (nKey == 0) { /*Quit*/ suppress = TRUE; PostQuitMessage(0); } else if (GetKeyState(VK_LWIN) < 0 || GetKeyState(VK_RWIN) < 0) { HWND hWnd = GetDesktopWindow(); if (hWnd != NULL) { hWnd = FindWindowEx(hWnd, NULL, _T("Shell_TrayWnd"), NULL); } if (hWnd != NULL) { hWnd = FindWindowEx(hWnd, NULL, REBARCLASSNAME, NULL); } if (hWnd != NULL) { hWnd = FindWindowEx(hWnd, NULL, TOOLBARCLASSNAME, _T("Quick Launch")); } if (hWnd != NULL) { suppress = TRUE; DWORD btnSize = SendMessage(hWnd, TB_GETBUTTONSIZE, 0, 0); LONG coord = MAKELONG((nKey - 1) * LOWORD(btnSize), 0); PostMessage(hWnd, WM_LBUTTONDOWN, 0, coord); PostMessage(hWnd, WM_LBUTTONUP, 0, coord); } } } if (suppress) { return 1; } else if (hHook == NULL) { return 0; } else { return CallNextHookEx(hHook, nCode, wParam, lParam); } } int WinMainCRTStartup() { HINSTANCE hInstance = GetModuleHandle(NULL); hHook = SetWindowsHookEx(WH_KEYBOARD_LL, &KeyboardHook, hInstance, 0); if (hHook != NULL && hHook != INVALID_HANDLE_VALUE) { MSG msg; BOOL success; while (success = GetMessage(&msg, NULL, 0, 0)) { if (success == -1) { break; } TranslateMessage(&msg); DispatchMessage(&msg); } } return 0; }