A-42 Programmer’s Manual
//************************************************************
//* MyMessageWindow
//* Description
//************************************************************
public MyMessageWindow(Form1 myForm)
{
objForm = myForm;
unScanMsgID =
(UInt32)RegisterWindowMessage(STR_SCANMSG);
}
//************************************************************
//* WndProc
//* Description
//************************************************************
protected override void WndProc(ref
Microsoft.WindowsCE.Forms.Message msg)
{
int nBarType = 0;
if (msg.Msg == unScanMsgID)
{
if (msg.WParam.ToInt32() == SM_SCANCHAR)
{
objForm.txtScanData.Text +=
Convert.ToChar(msg.LParam.ToInt32());
count--;
if (count == 0)
{
strScanData = objForm.txtScanData.Text;
PrintLabel();
}
}
if (msg.WParam.ToInt32() == SM_SCANSTATUS)
{
nBarType = (msg.LParam.ToInt32() >> 16) & 0xFFFF;
count = msg.LParam.ToInt32() & 0xFFFF;
objForm.txtScanLength.Text = ""+count;
if(objForm.txtScanLength.Text == "65535")
{
objForm.txtScanLength.Text = "";
objForm.txtScanType.Text = "No Scan";
}