VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/VBoxHook/testcase/tstHook.cpp@ 62114

Last change on this file since 62114 was 62114, checked in by vboxsync, 9 years ago

Placate cppcheck, explicitly close event handle.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 1.3 KB
Line 
1/*
2 * Copyright (C) 2006-2010 Oracle Corporation
3 *
4 * This file is part of VirtualBox Open Source Edition (OSE), as
5 * available from http://www.virtualbox.org. This file is free software;
6 * you can redistribute it and/or modify it under the terms of the GNU
7 * General Public License (GPL) as published by the Free Software
8 * Foundation, in version 2 as it comes in the "COPYING" file of the
9 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
10 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
11 */
12
13
14/*********************************************************************************************************************************
15* Header Files *
16*********************************************************************************************************************************/
17#include <windows.h>
18#include <VBoxHook.h>
19#include <stdio.h>
20
21int main(int argc, char **argv)
22{
23 printf("Enabling global hook\n");
24
25 HANDLE hEvent = CreateEvent(NULL, FALSE, FALSE, VBOXHOOK_GLOBAL_WT_EVENT_NAME);
26
27 VBoxHookInstallWindowTracker(GetModuleHandle("VBoxHook.dll"));
28 getchar();
29
30 printf("Disabling global hook\n");
31 VBoxHookRemoveWindowTracker();
32 CloseHandle(hEvent);
33
34 return 0;
35}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette