Click here to Skip to main content
11,928,003 members (28,064 online)
Click here to Skip to main content
Alternatives (1)
Add your own
alternative version

Tagged as


7 bookmarked

Simulate a keystroke in windows

, 22 Feb 2011 CPOL
This tip shows how to simulate a key stroke in windows environment


Members may post updates or alternatives to this current article in order to show different approaches or add new features.

1 Sep 2011
Jose David Pujo
With SendInput:void SetNumLock (bool active){ BYTE keyState[256]; GetKeyboardState((LPBYTE)&keyState); bool active0= keyState[VK_NUMLOCK] & 1; if (active0!=active) { INPUT inp[2]; ZeroMemory(inp, sizeof(inp)); inp[0].type=INPUT_KEYBOARD; ...


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Mukit, Ataul
Chief Technology Officer Rational Technologies
Bangladesh Bangladesh
Your Lord does not like people who waste by extravagance, and only the righteous C s, and does so in increments, and they are of those people who are mindful of what memory and time has in offer and they waste none of it.

| | Privacy | Terms of Use | Mobile
Web01 | 2.8.151126.1 | Last Updated 22 Feb 2011
Article Copyright 2011 by Mukit, Ataul
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid