RegisterWindowMessage Noob Help please

R

RB0135

Hi All,

I am writing a C# app for a Windows CE5 device that has a barcode
scanner built into it (a CypherLabs 9400).

To get the info from the barcode scanned, the programming manual
states to setup a RegisterWindowMessage call and I have have done this
code:

uint nDecodeMsg = RegisterWindowMessage("WM_DECODEDATA");

I have done that without issues, but for the life of me, how do you
know when a message is present.

I have tried to look at some examples and one example mentioned to use
something like this:

protected override void WndProc(ref Message m)
{
//calling the base first is important, otherwise the
values you set later will be lost
base.WndProc(ref m);

//if the window message id equals the nDecodeMsg message
id
if ((UInt32)m.Msg == nDecodeMsg)
{
/* Do Stuff here */
}
}

However, on the first line (ref Message m), the Message throws a
compile error "Type or Namespace Message cannot be found".

I am a total noob in this area (I think I understand C# enough), but

Am I going on the right path?

Is there an actual example of how to set up the "watcher/listner" for
the WindowMessage.

I have looked a lot for examples, but either I am missing the point,
or just cant find the answer..

Any help????

Thanks in advance...
 
R

RB0135

Thanks for the response Chris,

BUT

When I right click on it, there is no resolve.

Visual Studio is putting a squiglly blue line under it (not the red I
am accustomed to) and going by some MS doco, it states that all I need
is the using system.windows.forms statement which I have.

Robert
 
C

Chris Tacke, eMVP

What version of Studio are you using? Resolve has been there as a tool
since at least '05. What version of the CF are you targeting?


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com


Thanks for the response Chris,

BUT

When I right click on it, there is no resolve.

Visual Studio is putting a squiglly blue line under it (not the red I
am accustomed to) and going by some MS doco, it states that all I need
is the using system.windows.forms statement which I have.

Robert
 
R

RB0135

Chris,

Sorry, should have mentioned that in the original post

- VS 2005
- Windows CE5
- .netCF 2.0

Thanks,
Robert
 
P

Peter Foot [MVP]

Have you added a reference to Microsoft.WindowsCE.Forms to your project?

Peter

--
Peter Foot
Microsoft Device Application Development MVP
peterfoot.net | appamundi.com | inthehand.com
APPA Mundi Ltd - software solutions for a mobile world
In The Hand Ltd - .NET Components for Mobility

Chris,

Sorry, should have mentioned that in the original post

- VS 2005
- Windows CE5
- .netCF 2.0

Thanks,
Robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top