?? main.cpp
字號(hào):
#include <windows.h>#include <stdlib.h>#include <stdio.h>void ErrorExit(const char *lpszFunction){ char szBuf[80]; LPVOID lpMsgBuf; DWORD dw = GetLastError(); FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR) &lpMsgBuf, 0, NULL ); fprintf(stderr, "%s failed with error %d: %s", lpszFunction, dw, lpMsgBuf); LocalFree(lpMsgBuf); ExitProcess(dw);}int main(int argc, char **argv){ HOOKPROC hkprc; static HINSTANCE hinstDLL; static HHOOK hhook; char buff; hinstDLL = LoadLibraryA("tslib12.dll"); if (hinstDLL == NULL) { ErrorExit("LoadLibrary"); } hkprc = (HOOKPROC)GetProcAddress(hinstDLL, "_CallWndProc@12"); if (hkprc == NULL) { fprintf(stderr, "Failed to get procaddress\n"); return 2; } hhook = SetWindowsHookEx(WH_GETMESSAGE,hkprc,hinstDLL,0); if (hhook == NULL) { fprintf(stderr, "Failed to insert hook\n"); return 3; } printf("Hook installed. Press any key to abort, abort, abort!\n"); fread(&buff, 1, 1, stdin); printf("Uninstalling...\n"); if (! UnhookWindowsHookEx(hhook)) { fprintf(stderr, "Failed to remove hook. This is kinda critical.\n"); return 4; } return 0;}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -