Intercepting Messages in C# / .NET CF

  • Thread starter Thread starter mrader
  • Start date Start date
M

mrader

Hi
Can anybody tell me how to intercept Windows Messages in
CE .NET, using C#? THe WND Proc is not available to
override, nor is there a possibility to override
Preprocessmessage nor have I found a way to add an
IMessageFilter?
I wonder how programming can be done at all using the CF?
I just wanted to get some information on the mouse wheel.
But this seems impossible using the compact framework.
 
I'm not sure about what mousewheel you are referring to, but you can create
your own class that inherits from MessageWindow and just override WndProc if
I understand your correctly.

protected override void WndProc(ref Message msg)
{
switch(msg.Msg)
{
case WM_NOTIFY:
break;

}

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

}
 
OK, here's what I want to do:
I want to create a windows form using the .NET compact
framework. The form has button's with characters (A..Z),
which are used for text entry.
When the mouse wheel of a microsoft wheel mouse is
scrolled, the focus should go from one button to the
next, and so forth.
When the wheel is scrolled, I receive WM_MOUSEWHEEL.
However, I cannot intercept this message in a CE .NET
compact framework win form. (It is easy in a standard win
form).
I understand that there is a possibility to create a
message window. However, I cannot see how i can use this
for my problem? The message window should ideally call a
function in my .NET Winform application. Can you help?
Regards,

Michael
 
I think the point they were trying to make is that few (none that I've
actually seen) CE devices that have a mouse driver that supports the mouse
wheel. If you have a driver that does support it, then the OEM will have
some mechanism for getting said notifications, but I don't think the OS has
any standard on it.

-Chris
 
If you're sure that your CE device does give a WM_MOUSEWHEEL message, you
may be able to use a MessageWindow to catch it. Another option is to write
your own message pump and forego Application.Run, which would give you the
hook for all messages.

-Chris
 
Would be the same with any othe rwindows message. How can
I get access to the windows messages of a given win form
in CE.NET?
 
Back
Top