C Simulating Keys Simplified!

Advertisements

  Top Tutorials     New Tutorials     Submit     Login     Register  

Tutorial Detail

C Simulating Keys Simplified!

Ok, for those who do not know already, the simplest way to simulate a key press is by using the Windows API function.
http://www.pixel2life.com/publish/tutorials/778/_c_simulating_keys_simplified/
  • Total Hits: 13352

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating

  •  

  • Total Votes: 139 votes

  • Category: C and C++/General Development

  • Submitted on: 2008-04-16 02:23:40

  • Submitted By: Shekhar

  • Set as Favorite

Description:

The function "keybd_event" takes 4 parameters, by looking at msdn (http://msdn2.microsoft.com/en-us/library/ms646304(VS.85).aspx) we can see what these parameters are:

VOID keybd_event(

BYTE bVk,

BYTE bScan,

DWORD dwFlags,

PTR dwExtraInfo
);

to simulate a key press we only we need to supply the function with the first parameter, which is a Virtual Key Code (will be referred to as VKC from now on). Here is a link to the full list of VKC's: http://msdn2.microsoft.com/en-us/library/ms645540(VS.85).aspx    More detail...

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 38.85%  54
 Two starsTwo star  Vote LeftVote MiddleVote Right 10.07%  14
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 11.51%  16
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 10.79%  15
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 28.78%  40

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.





Advertisements
Advertisements