'KeyCodeConstants is not defined'

L

Larry Lard

Daniel said:
In my never ending search for keyboard simulation I found this code;

http://www.developerfusion.co.uk/show/68/2/

However, when I copy and paste, I get the errors;

'KeyCodeConstants is not defined'
and
'vbKeyShift is not declared'

What do I do to make them work?

The code on that webpage is VB6. How can I tell? The first line - the
last two parameters to the API call (which are DWORD and ULONG_PTR, 32
bit integers) are declared as Long. Only in VB6 is a Long a 32 bit integer.

So you will have to translate this sample slightly to make it usable in
VB.NET. The VB6 KeyCodeConstants enumeration has become the Keys
enumeration in System.Windows.Forms; vbKeyShift has become Shift;
vbKeyCtrl has become Ctrl. You'll also want to fix that Declare to use
Int32s rather than Longs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top