Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Using GetAsyncKeyState API to Identify Key
Author:
vivek Janakiraman
E-mail:
Click to e-mail author
Submitted:
4/1/2006
Version:
VB6
Compatibility:
VB6
Category:
Windows API
Views:
68479
This snippet shows the user how to get the key pressed. That is if the user presses control key that key is identified. Using this we can develop applications with greater flexibility. For example we can make an application to close if a key is pressed and so on. This code is basically a smaller one with greater potential. It just contains three lines of code.
Declarations:
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Code:
On Error Resume Next 'To check wheteher Control key is pressed If GetAsyncKeyState(17) Then msgbox "Control key pressed" End If
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement