

LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) Return CallNextHookEx( g_hKeyboardHook, nCode, wParam, lParam ) If (nCode vkCode = VK_LWIN) || (p->vkCode = VK_RWIN))) LRESULT CALLBACK LowLevelKeyboardProc( int nCode, WPARAM wParam, LPARAM lParam ) G_hKeyboardHook = SetWindowsHookEx( WH_KEYBOARD_LL, LowLevelKeyboardProc, GetModuleHandle(NULL), 0 ) INT WINAPI WinMain( HINSTANCE, HINSTANCE, LPSTR, int ) Using a low-level keyboard hook to disable the Windows key HHOOK g_hKeyboardHook This method is used by DXUT and is illustrated in the following code example.Įxample 1. This method also works with least-privileged user accounts (also known as limited-user accounts). This method works on Windows 2000 and later versions of Windows. The code in Example 1 does this by handling the WM_ACTIVATEAPP message. This means that you must be careful to ensure that the Windows key is not disabled when the application is deactivated. The low-level keyboard hook shown in Example 1 remains in effect even if a user minimizes the window or switches to another application.

Use a low-level keyboard hook to filter out the Windows key from being processed.

This articles describes how to temporarily disable keyboard shortcuts in Microsoft Windows to prevent disruption of game play for full screen games.
