Handling Remote Control Event in C#

V

vijay

Hi

I am using a carnavigator Device. the Device have a remote control and
Hardware buttons.

when ever a key pressed on remote control or Hardware buttons is
pressed, the driver sends a Message to the application.

Example: Volume Increase Button: when we press this button WM_VOLUME_UP
event is sent to the application.

in EVC++, i used to handle these events in "WndProc", how to handle the
events in C# using .net Compact Framework.

i tried to Override the WndProc in a Form,

protected override void WndProc( ref Message msg )
{
//.... Message handling prrocedure

// call the base class WndProc for default message handling
//
base.WndProc( ref msg );
}

when i compile, i am getting the following error.

'HardwareKeyAccess.Form1.WndProc(ref
Microsoft.WindowsCE.Forms.Message)': no suitable method found to
override

I search this fourm, i found WndProc is not supported in .netCF

http://groups.google.co.in/group/mi...67cdbcbbe58?q=WndProc&rnum=4#d0cb067cdbcbbe58

How to handle the Remote Contorl events in .net cf?

Thank you
 
D

DJMatty

That link describes a messagewindow class that can only listen for
messages that the class itself creates. It won't work for what you
require as you are not generating the messages.

It seems that controls and forms in .net (desktop, not sure about
compact framework) do provide a wndproc method that you can override.

http://www.thescripts.com/forum/thread229459.html

Or you can use the NativeWindow class as Charles Petzold describes in
his article here:

http://www.charlespetzold.com/pwcs/NativeWindow.html

HTH

Matt
 
D

DJMatty

My mistake,

It seems that those are all desktop framework classes and methods, so
you will need to use messagewindow, which is a .netcf class. It won't
let you monitor o/s messages but I guess it should be ok for your
messages...

Sorry

Matt
 

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