473,788 Members | 2,694 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to catch WM_NCMOUSEMOVE in MDI Form?

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_NCMOUS EMOVE)
Utils.Beep(1100 0, 20);

base.WndProc(re f m);
}

Jun 27 '08 #1
3 3077
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.

"Polaris" <et*******@hotm ail.comwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
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_NCMOUS EMOVE)
Utils.Beep(1100 0, 20);

base.WndProc(re f m);
}
Jun 27 '08 #2
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.

--
Happy Coding!
Morten Wennevik [C# MVP]
"Polaris" wrote:
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_NCMOUS EMOVE)
Utils.Beep(1100 0, 20);

base.WndProc(re f m);
}

Jun 27 '08 #3
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...

"Morten Wennevik [C# MVP]" <Mo************ @hotmail.comwro te in message
news:AE******** *************** ***********@mic rosoft.com...
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.

--
Happy Coding!
Morten Wennevik [C# MVP]
"Polaris" wrote:
>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_NCMOUS EMOVE)
Utils.Beep(1100 0, 20);

base.WndProc(re f m);
}

Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3254
by: DraguVaso | last post by:
Hi, In my application, on some given actions while debugging in Visual Studio, I suddenly get a "System.ComponentModel.Win32Exception was unhandled" Message="Error creating window handle." exception. The problem is that this exception isn't raised somewhere in a method, so it just shows up, and it causes the application to shut down. Is there anyway how to catch this kinds of exceptions? Can I put somewhere a
2
4397
by: Galina | last post by:
Hello I have an application in MS Access 2000. I have a form, which includes a subform. The subform is based on a table, but locked for any editing. There is Edit button. When clicked, it starts a separate unbound form with all the fields, which are on the subform. The fields are filled in with data programmatically. User edits. Edited fields are copied into fields on the subform programmatically as well. I need to catch change in one of...
11
3493
by: Pohihihi | last post by:
I was wondering what is the ill effect of using try catch in the code, both nested and simple big one. e.g. try { \\ whole app code goes here } catch (Exception ee) {}
23
3083
by: VB Programmer | last post by:
Variable scope doesn't make sense to me when it comes to Try Catch Finally. Example: In order to close/dispose a db connection you have to dim the connection outside of the Try Catch Finally block. But, I prefer to dim them "on the fly" only if needed (save as much resources as possible). A little further... I may wish to create a sqlcommand and datareader object ONLY if certain conditions are met. But, if I want to clean these up in the...
1
5436
by: angus | last post by:
Dear All, how to try-catch "A potentially dangerous Request.Form value was detected from the client (txtUserName="<asdf")." this exception? i've set the debugger in the Page_InIt function, but this page is shown before the Page_init function. i know that i can set validateRequest="false" in my page, but how can i
34
4885
by: Bob | last post by:
Hi, The compiler gives Warning 96 Variable 'cmdSource' is used before it has been assigned a value. A null reference exception could result at runtime. Dim cmdSource as SQlClient.SQLDataReader Try Set up the database read and do it. Catch ex as system.exception exception stuff here Finally
5
3404
by: Simon Tamman {Uchiha Jax} | last post by:
Now this is bugging me. I just released software for a client and they have reported an unhandled stack overflow exception. My first concern is that the entirity of the UI and any threaded operations are all within Try Catches to help me locate the problem and the origination of any problem by specifiying an error code in the "Catch" section. So theoretically this shouldn't have been possible (at which point we all say "yeah,...
0
1670
by: Nickneem | last post by:
I' m trying to disable all right mouse clicks by using the vbAccelerator Windows Hooks Library The small (systray / console) app. must catch all (right) mouseclicks before they are received by the users application (for instance IE). I' m not getting passed the stage where I write to the console catching clicks on my applications form.. I really doubt if this one's possible at all (especially for an API noob like me)..
4
1861
by: bad_boyu | last post by:
Hello, I have the following code: try { Salarii.Editors.AngajatiNewFrm _angNewFrm = new Salarii.Editors.AngajatiNewFrm(); _angNewFrm.Connection = this.Connection; _angNewFrm.ShowInTaskbar = false; _angNewFrm.ShowDialog();
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10113
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.