Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 8th, 2004, 11:49 AM
Registered User
 
Join Date: Sep 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Non-Client Mouse Messages?

Hi,

I'm playing around with detecting mouse messages and discovered that there seems to be no native way of detecting mouse messages in a control's border (the non-client area). I could do this in Win32 with a custom message handler - is there a way to do this jnatively in .NET/C#?

Thanks in advance.



Jim Stanley
Media Services, Inc.
 
Old September 9th, 2004, 03:22 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

You can override WndProc like this

        [System.Security.Permissions.PermissionSet(System.S ecurity.Permissions.SecurityAction.Demand, Name="FullTrust")]
        protected override void WndProc(ref Message m)
        {
            switch (m.Msg)
            {
                case WM_NCMOUSEMOVE:

                    break;
            }
            base.WndProc(ref m);
        }

declare a constant where you have declared your other variables
        private const int WM_NCMOUSEMOVE = 0x00A0;
 
Old September 9th, 2004, 03:24 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

For other messages you might wanna intercept look into winuser.h for their corresponding values.
 
Old September 9th, 2004, 10:58 AM
Registered User
 
Join Date: Sep 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Guys!



Jim Stanley
Media Services, Inc.
 
Old February 20th, 2007, 01:56 PM
Registered User
 
Join Date: Feb 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Since there is no WndProc - Method with WPF.
How could I achieve nonetheless ?
(Would appreciate code snippets if possible as well)

Thx in advance.





Similar Threads
Thread Thread Starter Forum Replies Last Post
connecting client to client (Socket programming) maricar C# 0 September 25th, 2008 04:34 AM
Messages RobCarter VB Databases Basics 1 September 13th, 2006 03:03 PM
Error messages ldoodle Access ASP 12 June 6th, 2005 01:05 PM
Messages with ASP AmitG Classic ASP Basics 3 March 24th, 2004 12:54 PM
System messages bph Access 8 March 1st, 2004 03:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.