Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / April 2006

Tip: Looking for answers? Try searching our database.

Handling Remote Control Event in C#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vijay - 26 Apr 2006 03:52 GMT
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/microsoft.public.dotnet.framework.compactframew
ork/browse_thread/thread/4383bed1861bb7e0/d0cb067cdbcbbe58?q=WndProc&rnum=4#d0cb
067cdbcbbe58


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

Thank you
vijay - 26 Apr 2006 04:39 GMT
i found good sample application to handle the windows events , check
this link

http://samples.gotdotnet.com/quickstart/CompactFramework/doc/messagewindow.aspx
DJMatty - 26 Apr 2006 05:22 GMT
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

> i found good sample application to handle the windows events , check
> this link
>
> http://samples.gotdotnet.com/quickstart/CompactFramework/doc/messagewindow.aspx
DJMatty - 26 Apr 2006 05:32 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.