473,387 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

CWnd and CStatic Based Windows, How to detect mouse leaving the w

Hello,

I am creating a new window class based on CWnd. I am placing it on the View
(CFormView). How can I get the notification or any other indication that
the cursor/mouse is not on this window?

I also tried the same to create a new window based on CStatic but I was not
able to detect when the mouse leaves the window.

Regards,
Eitan
Nov 17 '05 #1
2 2392
>I am creating a new window class based on CWnd. I am placing it on the View
(CFormView). How can I get the notification or any other indication that
the cursor/mouse is not on this window?


Have you tried TrackMouseEvent?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #2
Hallo Eitan!
I am creating a new window class based on CWnd. I am placing it on the View (CFormView). How can I get the notification or any other
indication that the cursor/mouse is not on this window?
I also tried the same to create a new window based on CStatic but I

was not able to detect when the mouse leaves the window.
Mouse messages are sent to the parent for CStatic windows. You can
override WM_NCHITTEST and return HTCLIENT. But AFAIK it is enough to set
the style SS_NOTIFY.

You can use TrackMouseEvent to get a message when the cursor leaves the
window.

Also you can get the current position of the cursor and you can compare
it with your window rect.

--
Martin Richter [MVP] WWJD
"In C we had to code our own bugs. In C++ we can inherit them."
FAQ : http://www.mpdvc.de
Samples: http://www.codeguru.com http://www.codeproject.com
Nov 17 '05 #3

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

Similar topics

2
by: Benoit Martin | last post by:
Is it possible to detect a mouse click from a .net service. I want a process running in the background that will detect when the user clicks the mouse button (anywhere on the screen) and executes...
2
by: Sam Riggens | last post by:
I am experimenting with C# and trying to use an unmanaged C++ dll. The UMC++ dll has a function defined as follows: extern "C" bool DllExport ShowLogonDlg(CWnd *pParent, CConfig& cfg); The...
0
by: Eitan | last post by:
Hello, I am creating a new window class based on CWnd. I am placing it on the View (CFormView). How can I get the notification or any other indication that the cursor/mouse is not on this...
1
by: lauch2 | last post by:
After performing the following steps, what happen to my application or the system: 1. My application has a class, namely CMyWnd, which is inherited from CWnd. 2. Instantiate a CMyWnd object by:...
4
by: MorAdan | last post by:
Now Begin to learn Visual C++ and have a problem... How to change the properties of CStatic object in the program-code? I can't create a member variable associated with this object (as I did with,...
5
by: Jeff S | last post by:
I'm creating a new Windows Forms MDI application... How can I add cause the application to shut itself down after a period of ? I did this in an old COM/VB6 application and I had to have code...
6
by: Nathan Laff | last post by:
Why when I inherit a ComboBox and make no code changes, when I set the new control DropDownStyle to dropDownList it appears different than the standard ComboBox control on Vista? In Windows...
1
by: Przemek M. Zawada | last post by:
Dear Group, I have got two mice connected to one PC (notebook). In example I click parallel left button on mouse A and left button on mouse B. Is it possible, programmatically detect which on...
2
by: Mohit | last post by:
Hi all, I am working on a windows application with a list view on a form. Now I wanted to show hand cursor when mouse is over list view item and default(arrow) cursor at other places. List...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.