这是我试图在 Windows Store App 上重建的方法。有没有办法复制它?下面的代码是IDENTIVE的一段示例代码。
protected override void WndProc(ref Message aMessage)
{
if (aMessage.Msg == TNFCWrapper.WM_NFC_NOTIFY)
{
string s = "";
Int32 wParam = aMessage.WParam.ToInt32();
switch (wParam)
{
case TNFCWrapper.NFC_NDEF_FOUND:
s = "NFC_NDEF_FOUND Size = " + aMessage.LParam.ToString();
break;
case TNFCWrapper.NFC_DEVICE_CHANGED:
s = "NFC_DEVICE_CHANGED";
break;
case TNFCWrapper.NFC_UNKNOWN_SERVICE:
s = "NFC_UNKNOWN_SERVICE";
break;
case TNFCWrapper.NFC_CONNECTED:
s = "NFC_CONNECTED";
break;
case TNFCWrapper.NFC_DISCONNECTED:
s = "NFC_DISCONNECTED";
break;
case TNFCWrapper.NFC_IDLE:
s = "NFC_IDLE";
break;
default:
s = "UNKNOWN";
break;
}
System.Diagnostics.Debug.WriteLine(s);
if (wParam == TNFCWrapper.NFC_DEVICE_CHANGED) DeviceCountLabel.Text = aMessage.LParam.ToString();
if (wParam == TNFCWrapper.NFC_NDEF_FOUND) ReadNDEF();
}