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 / Languages / C# / April 2008

Tip: Looking for answers? Try searching our database.

How to catch WM_NCMOUSEMOVE in MDI Form?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Polaris - 29 Apr 2008 05:28 GMT
Hi C# Experts:

I'm writing a C# MDI program. I need to know when user is moving mouse on
MDI's non-client area (that dark-gray background). I have tried code below
but it did not catch the user's action. Anyone knows how it should be done?

Thanks in advance.
Polaris

protected override void WndProc (ref Message m)
{
           if (m.Msg == Utils.WM_NCMOUSEMOVE)
                 Utils.Beep(11000, 20);

           base.WndProc(ref m);
}
Polaris - 29 Apr 2008 06:31 GMT
Correction, the message I need to catch is WM_MOUSEMOVE, I have tried the
code (posted below) with WM_MOUSEMOVE, but still not catching it.

> Hi C# Experts:
>
[quoted text clipped - 13 lines]
>            base.WndProc(ref m);
> }
Morten Wennevik [C# MVP] - 29 Apr 2008 06:51 GMT
Hi Polaris,

When you create an MDI window, the MDI canvas is actually a separate control
and not the non client area of the MDI parent.  This canvas control traps the
mouse events and I'm not sure how, or if it is possible, to get these mouse
events.

Signature

Happy Coding!
Morten Wennevik [C# MVP]

> Hi C# Experts:
>
[quoted text clipped - 12 lines]
>             base.WndProc(ref m);
> }
Polaris - 30 Apr 2008 04:48 GMT
Thanks Morten.

I think there should a way to do it because I tried the Spy++, it can detect
mouse actions (WM_MOUSEMOVE, WM_LBUTTONDOWN...) accurately...

> Hi Polaris,
>
[quoted text clipped - 24 lines]
>>             base.WndProc(ref m);
>> }

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.