Keyboard Wedging

A

Arthur Dent

Hi all...

I am hoping someone can point me to some good example code here; we have a
handheld scanner, based on WM5, with a mag-stripe reader; All works good...
i can swipe a card, read the input all a-okay;

Now what i need to do is to "wedge" the data from the magstripe into the
keyboard buffer, so it shows up in whatever program has the input focus.
I have been searching for hours, and everywhere i look it looks like people
are saying what i need is the API call PostKeybdMessage(). Okay.

Only problem is, i cannot find a SINGLE example of how to use this function
from VB.NET (2005).
Can anyone point me in the direction or have handy some good example code of
how to call PostKeybdMessage from VB.NET 2005?

I found some C# examples, which i'd normally be able to convert okay, but
there's some hairy stuff in handling the API declarations and calls, and i
don't seem to be able to get it right.

Thanks in advance,
Arthur Dent.
 
A

Arthur Dent

That is for VB6, and does not give the proper "Import"specification for the
dll routine;

Also, from what i was reading, and finding, keybd_event does not handle
upper/lowercase, does it? I think for that you need to use PostKeybdMessage.
 
P

Paul G. Tobey [eMVP]

For upper/lower case, you'd send Shift+Key+Key-Up+Shift-Up.

However, if you are *only* wedging printable characters, you can stick with
PostKeybdMessage; you don't need keybd_event.

Paul T.
 

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