Receiving Windows Message in Unity (WndProc)

I need to react to the event of a Kiosk Program.

We are making an unmanned payment system with Unity,
and run the card reader program together.

The card reader program sends Windows messages to Unity depending on the situation.
(ex Card Insert → 1326, Card Read Error → 1327)

C# Windows Program it works really well, but I can’t get it to work with unity.
I think because it relies on the existence of Windows Forms, which Unity or Mono does not have.

Are there any ideas?

protected override void WndProc(ref Message msg)
{
    	base.WndProc(ref msg);
    
    	const int RF_CARD_INSERT = 1329;
    	const int RF_CARD_REMOVE = 1336;
    	const int RF_IC_ERROR = 1327;
    
    	switch (msg.Msg)
    	{
    		case RF_CARD_INSERT:
    	                // Do Something
    			Debug.Log("Message: " + msg.Msg);
    			break;
    		case RF_CARD_REMOVE:
    	                // Do Something
    			Debug.Log("Message: " + msg.Msg);
    			break;
    		case RF_IC_ERROR:
    	                // Doing Something
    			Debug.Log("Message: " + msg.Msg);
    			break;
    
    		default:
    			break;
}

跑通整体流程
https://www.laowangomg.com/?p=579

提供新建 window instance 来监听 WndProc