I did it. It depends on your manufacturer. I used both serial and USB
swipe readers. Handling COM one is very trivial; just connect serial
port, and read data (asynchronously). For USB, manufacturer, mine was
Magtek, provides a HID driver that creates a COM port. Then you need to
do the same things you do with COM device. Finally, Magtek has another
USB device, which's a keyboard emulation. In my case, the focus was
guaranteed to be on a specific window, because there was no keyboard
and there was no touch screen - there is no way for user to change the
focus. In this case, when card is swiped, I was catching WM_CHAR
messages, placing them into a buffer.
Ismail