Messaging API

To use the Read‑a‑Card messaging API, your application must register with Read‑a‑Card by sending a custom Windows message to the Read‑a‑Card main window. That message provides Read‑a‑Card with your application’s window handle.

Since your application will be assigned a different window handle each time it runs, your application will need to send the register message to Read‑a‑Card whenever it or Read‑a‑Card is restarted.

When registered, Read‑a‑Card will notify your application whenever a card is presented. To do this, Read‑a‑Card sends a WM_COPYDATA message to your application, using the window handle that was provided in the registration step. The WM_COPYDATA message is a standard method of transferring data in shared memory between two applications under Windows. The data transferred in this message includes the card ID, card type, reader ID (where available) and timestamp, as 4 unicode character strings.

Ideally, when your application closes or no longer requires the Read‑a‑Card notification messages, it should send an unregister message to Read‑a‑Card to stop the notification messages being sent.