Changeset 95871 in vbox for trunk/src/VBox/Additions/WINNT/VBoxHook/testcase
- Timestamp:
- Jul 27, 2022 2:38:21 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxHook/testcase/tstHook.cpp
r93115 r95871 22 22 #include <iprt/win/windows.h> 23 23 #include <VBoxHook.h> 24 #include <stdio.h>25 24 26 25 27 26 int main() 28 27 { 29 printf("Enabling global hook\n"); 28 DWORD cbIgnores; 29 WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), RT_STR_TUPLE("Enabling global hook\r\n"), &cbIgnores, NULL); 30 30 31 31 HANDLE hEvent = CreateEvent(NULL, FALSE, FALSE, VBOXHOOK_GLOBAL_WT_EVENT_NAME); 32 32 33 33 VBoxHookInstallWindowTracker(GetModuleHandle("VBoxHook.dll")); 34 getchar();35 34 36 printf("Disabling global hook\n"); 35 /* wait for input. */ 36 uint8_t ch; 37 ReadFile(GetStdHandle(STD_INPUT_HANDLE), &ch, sizeof(ch), &cbIgnores, NULL); 38 39 /* disable hook. */ 40 WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), RT_STR_TUPLE("Disabling global hook\r\n"), &cbIgnores, NULL); 37 41 VBoxHookRemoveWindowTracker(); 38 42 CloseHandle(hEvent);
Note:
See TracChangeset
for help on using the changeset viewer.