Mouse move on parent window and child window

Hi all,

I have static conrol when i mouse move on this control then a dialog control 
will display on static' s region(dialog is child of static control), when 
mouse leave then dialog will hide, but i have problem is when mouse move on 
dialog then on static is mouse leave, i want when mouse move on dialog then 
mouse move on static control too. anybody have solution to solve this 
problem, pls help me?

Thanks very much,
David, 


0
11/26/2007 11:09:04 AM
vc.mfc 33608 articles. 0 followers. Follow

8 Replies
2148 Views

Similar Articles

[PageSpeed] 59

This is probably the wrong approach.  Look at TraceMouseEvent and WM_MOUSELEAVE as
alternatives.  There is no guarantee that you will see the mouse hit any particular window
because the mouse can be seen to move in "jumps" which can be arbitrarily wide.
					joe

On Mon, 26 Nov 2007 18:09:04 +0700, "David" <thuong101277@yahoo.com> wrote:

>Hi all,
>
>I have static conrol when i mouse move on this control then a dialog control 
>will display on static' s region(dialog is child of static control), when 
>mouse leave then dialog will hide, but i have problem is when mouse move on 
>dialog then on static is mouse leave, i want when mouse move on dialog then 
>mouse move on static control too. anybody have solution to solve this 
>problem, pls help me?
>
>Thanks very much,
>David, 
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
11/26/2007 1:30:42 PM
There are some things that are unclear:
What is a relationship between dialog and static control? 
In your post you stated: dialog is child of static control.
If this is correct where static control is located?
Is it necessary to make dialog a child of a static control?

-- 
RainMan


"David" wrote:

> Hi all,
> 
> I have static conrol when i mouse move on this control then a dialog control 
> will display on static' s region(dialog is child of static control), when 
> mouse leave then dialog will hide, but i have problem is when mouse move on 
> dialog then on static is mouse leave, i want when mouse move on dialog then 
> mouse move on static control too. anybody have solution to solve this 
> problem, pls help me?
> 
> Thanks very much,
> David, 
> 
> 
> 
0
RainMan6256 (150)
11/26/2007 2:54:00 PM
Its not clear what you are asking. If you think a mouse event can be handled 
in two separate windows, by default MFC will not allow it.

There are ways to get around it though, inlcuding using the ever useful 
CSubclassWnd by Paul Dilascia. Google for it in this ng or msdn.

---
Ajay

"David" <thuong101277@yahoo.com> wrote in message 
news:%23OrvBzBMIHA.2064@TK2MSFTNGP06.phx.gbl...
> Hi all,
>
> I have static conrol when i mouse move on this control then a dialog 
> control will display on static' s region(dialog is child of static 
> control), when mouse leave then dialog will hide, but i have problem is 
> when mouse move on dialog then on static is mouse leave, i want when mouse 
> move on dialog then mouse move on static control too. anybody have 
> solution to solve this problem, pls help me?
>
> Thanks very much,
> David,
> 

0
ajaykalra (6842)
11/27/2007 2:55:07 AM
"Ajay Kalra" wrote:
> Its not clear what you are asking. 

I am not sure what is unclear. Could you elaborate?
In general I am trying to establish a relationship between main dialog, 
static control and a dialog that is claimed to be a child window of a static 
control.

"Ajay Kalra" wrote:
>If you think a mouse event can be handled  in two separate windows, by default MFC will not allow it.

Well, neither I nor David mentioned any events. I do not think David’s 
application any events; there is no COM involved, nor threads 
synchronization. I am not sure why you have mentioned events. 
MFC does not limit number of object that may receive event notification. In 
terms of mouse messages MFC also has nothing to do with preventing mouse 
messages to be sent to multiple windows; Windows OS sends mouse messages only 
to a windows that mouse cursor is over.
One exception is a static window (control) that does not have SS_NOTIFY style.

"Ajay Kalra" wrote:
> There are ways to get around it though, inlcuding using the ever useful 
> CSubclassWnd by Paul Dilascia. Google for it in this ng or msdn.

I am not sure why subclassing would be helpful in this case. MFC already 
subclassed dialogs and controls.


Anyway, in conclusion:
I am not sure if Dave’s application complexity (layers of windows) is needed 
here. I am trying to establish if static control is really needed here. There 
is also common confusion when window is being referred to as child window. 
Very often child is used to describe window that is just being owned by 
others. 

I cannot see a code; that is why answering questions that I posted would 
allow me to suggest the best approach (in agreement with my MEMC paradigm).


-- 
RainMan


"Ajay Kalra" wrote:

> Its not clear what you are asking. If you think a mouse event can be handled 
> in two separate windows, by default MFC will not allow it.
> 
> There are ways to get around it though, inlcuding using the ever useful 
> CSubclassWnd by Paul Dilascia. Google for it in this ng or msdn.
> 
> ---
> Ajay
> 
> "David" <thuong101277@yahoo.com> wrote in message 
> news:%23OrvBzBMIHA.2064@TK2MSFTNGP06.phx.gbl...
> > Hi all,
> >
> > I have static conrol when i mouse move on this control then a dialog 
> > control will display on static' s region(dialog is child of static 
> > control), when mouse leave then dialog will hide, but i have problem is 
> > when mouse move on dialog then on static is mouse leave, i want when mouse 
> > move on dialog then mouse move on static control too. anybody have 
> > solution to solve this problem, pls help me?
> >
> > Thanks very much,
> > David,
> > 
> 
0
RainMan6256 (150)
11/27/2007 7:56:00 PM
On Nov 27, 2:56 pm, RainMan <Rain...@online.nospam> wrote:
> "Ajay Kalra" wrote:
> > Its not clear what you are asking.

I replied to David so I am not clear about what clarification you want
for my perceived lack of clarity :-)

> I am not sure why subclassing would be helpful in this case. MFC already
> subclassed dialogs and controls.

It allows the window to be subclassed only once. CSubClassWnd obviates
that limitation and hooks up to window procedure.

--
Ajay
0
ajaykalra (6842)
11/27/2007 8:07:07 PM
Sorry from a layout of the posts I got an impression that you are answering 
my post.

As for subclassing:
MFC is subclassing every window when it is created, replacing Window’s 
procedure with MFC procedure.
After that you can still subclass window using MFC. MFC does subclassing 
window in two stages: window is attached to MFC object and later window’s 
procedure is replaced by MFC class’ procedure. 
You are right MFC prevents further subclassing once window is attached to 
MFC object. 
You can still subclass window replacing current procedure with your own 
using SetWindowLong.
Again in this case I do not think that subclassing would help.

-- 
RainMan


"Ajay Kalra" wrote:

> On Nov 27, 2:56 pm, RainMan <Rain...@online.nospam> wrote:
> > "Ajay Kalra" wrote:
> > > Its not clear what you are asking.
> 
> I replied to David so I am not clear about what clarification you want
> for my perceived lack of clarity :-)
> 
> > I am not sure why subclassing would be helpful in this case. MFC already
> > subclassed dialogs and controls.
> 
> It allows the window to be subclassed only once. CSubClassWnd obviates
> that limitation and hooks up to window procedure.
> 
> --
> Ajay
> 
0
RainMan6256 (150)
11/27/2007 9:28:05 PM
On Nov 27, 4:28 pm, RainMan <Rain...@online.nospam> wrote:
> Sorry from a layout of the posts I got an impression that you are answering
> my post.
>

> You are right MFC prevents further subclassing once window is attached to
> MFC object.
> You can still subclass window replacing current procedure with your own
> using SetWindowLong.

Thats prcesiely what is done by CSubClassWnd. Its one of those MFC
goodies that surpasses any other in its usefulness.

> Again in this case I do not think that subclassing would help.

Dont know. It may or may not as I dont know what OP wants.

---
Ajay
0
ajaykalra (6842)
11/28/2007 1:30:56 AM
OK, we have a CDialog-derived class, and an instance of that CDialog-derived class which
is a child of a CStatic.  Why?  Why do you need to make it a child of a CStatic at all?
Why is it not just a child of the CDialog class that is going to contain it?  (I don't see
a benefit to putting it in a CStatic).

The question beyond this point is unclear.  It sounds like what you want is a way to cause
a dialog to become visible if you move over it, and hide when you leave it.  That's fairly
easy: you just watch for the mouse to be in the area occupied by the invisible dialog, and
if it is, make the dialog visible.  When the mouse is inside the dialog, it arms a
WM_MOUSELEAVE event; when you get that message, you hide the dialog.
					joe

On Mon, 26 Nov 2007 18:09:04 +0700, "David" <thuong101277@yahoo.com> wrote:

>Hi all,
>
>I have static conrol when i mouse move on this control then a dialog control 
>will display on static' s region(dialog is child of static control), when 
>mouse leave then dialog will hide, but i have problem is when mouse move on 
>dialog then on static is mouse leave, i want when mouse move on dialog then 
>mouse move on static control too. anybody have solution to solve this 
>problem, pls help me?
>
>Thanks very much,
>David, 
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
11/28/2007 6:37:40 AM
Reply:

Similar Artilces:

Windows 7 Discussion Group
Is there one? If so and I missed it I apologize. Thanks "RHinNC" <rhinnc@[get rid of this] hotmail.com> wrote in message news:OEORv3yhKHA.5604@TK2MSFTNGP04.phx.gbl... > Is there one? If so and I missed it I apologize. Thanks > There are Microsoft forums, but no Microsoft newsgroups. There is an alt.windows7.general newsgroup, though, if your ISP carries it. -- SC Tom On 12/27/2009 2:51 PM, RHinNC wrote: > Is there one? If so and I missed it I apologize. Thanks > > I have been using the alt.windows7.general which is available a free...

Why is my tab key moving my cursor from column A to column k?
In all of my excel worksheets, when I push Tab, my cursor goes straight from Column A to Column K or the next column not shown to the right of the sheet. From there, if I hit Shift-Tab It always goes back to column A, even if that's not where I started out. Please help, it's driving me crazy!!! Turn off Lotus 1-2-3 Transition options Tools, Options, Transition (tab), turn off all transition options --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvp...

E2K3
We currently have a mixed mode environment with Exchange 5.5 on NT 4.0 and Exchange 2003 on Windows 2000. We have completed the migration of our mailboxes and public folders to E2K3 and are in the process of decommissioning our 5.5 Site. We have a policy setup on our mail stores to send a warning when a user reaches 95MB and to prohibit sending at 100MB. We also have standards in place regarding the storage group/mail store location of our users on the E2K3 servers. The first problem we are experiencing is ESM is reporting a mailbox size that is significantly larger than what Outlook 2002 ...

Identify active window
I need to be able to identify which program is being used by the user. Getting the active window is easy with GetForegroundWindow but, how do I query that window to find out which program it is? What I mean is, how do I know it is GIMP and not Word? Or IE and not Netscape? If there is no general solution, I need to at least be able to identify Word and IE. Thank you all. I am wondering where you calling GetForgroundWindow and when you calling?after getting HWND a lottoff ways to identify , which program(check caption etc). Alexander wrote: > I need to be able to identify which progra...

Move message to folder
How can I get a message that I create from scratch go to a folder (other than "Sent Items") automatically after I send it? Hi. Me again. I don't think the above question was very clear. Let me explain. I can make a rule that will check the message after I send it and move a SINGLE COPY of that message to a certain folder. This is fine if I create the message by typing in the email address from a business card, for example. But if I "reply" to a message I get TWO COPIES of it in the folder because I've also checked the box that says: "In folders other than ...

Using arrow keys to move between cells
Hey guys, Sorry for dumb question, but how do I move between cells w/o using my mouse and rather using arrow keys? Do you have use any of shift, alt, ctrl keys at same time? Thanks. If pressing the arrow keys are not moving you between cells, check and see if scroll lock is on on the key board, here is some info from help Arrow keys Move one cell up, down, left, or right. CTRL+arrow key Move to the edge of the current data region. HOME Move to the beginning of the row. CTRL+HOME Move to the beginning of the worksheet. CTRL+END Move to the last cell on the worksheet, in the bottom-most us...

Deleting/Moving E-Mail Messages
Hi, My company is currently useing MS Office XP, 2000, and 97 (most people are using 97). When some users try to delete or move messages in Outlook (it does not matter which release) they receive a message that it can't be done. I think it may be because they have many messages on the Exchange Server and their account is very large, but I'm not sure. Does anyone have any information on how to correct this problem? Users are having a difficult time deleting messages or moving them into another folder. Thanks for any help you can give. ...

Outlook 2000 and Windows 98
I have one server and one domain. Some time back, the server went down and I had to rebuild it. In the process of doing this, I upgraded my Exchange Server from 5.5 to 2003. All of the clients had to be reset on the network. This went extremely smooth until I got to the Windows 98 clients. They can see the network and reach all resources except the Exchange server. I can't get the the profiles in Outlook set up. It won't authenticate the username or server name. Any suggestions? ...

Open Multiple Files In New Windows
I can't seem to find an instruction/direction for how to open Excel files in different windows. I want to compare a couple of charts next to each other and every time I open a new file, it opens it into the previous window, forever leaving me with only one file open. Thanks. Bright Spark Both workbooks are open.......you can just see one of them. Got to Window>New Window Then Window>Arrange>Vertical. Gord Dibben MS Excel MVP On Fri, 16 Mar 2007 21:34:41 -0700, Bright Spark <BrightSpark1901@Hotmail.com> wrote: >I can't seem to find an instruction/direction...

window pane size
When I open a message to read or reply, the window pane is too wide. Parts of the message on the right are cut off. And when I reply, parts of the sentence is cut off to the right. How do I adjust the pane size? Any window you want to resize permanently must be the last window closed. Grab the corners of the window and drag it to full screen size. Do not use Maximize. Close all other windows first via the Taskbar and this one last. Windows will remember the size used of the last window closed the next time you open the program. -- Bruce Hagen MS-MVP [Mai...

Windows Mail
When I try and send mail using windows mail (vista) I get this message I contacted comcast changes all ports etc and no luck. Also when I used to use outlook express and when to file I could change the identity there. I can't seen to find out how and both my email and wifes is going to the same inbox I hope someone has a suggestion. thanks Arthur The message could not be sent. The authentication setting might not be correct for your outgoing e-mail [SMTP] server. For help solving this problem, go to Help, search for "Troubleshoot Windows Mail", and re...

Need remote Clients to have open SMTP relay with windows authentication in Exchange 2003
Hi all ... first time posting here, but i have been able to find many answers to other questions in the past ... Unfortunatley I may be in a bit over my head with this one. I have about 100 remote users and until now they have not been required to send email over SMTP to domains out side of ours. Now we have a directive from above to allow relaying from dialup and remote users but need to setup SMTP authentication. Current config ... Server: Windows 2003 server Exchange 2003 server SP1 Firewall permitting any traffic on ports 110 and 25 Security options for SMTP in the System Manager is se...

moving mailboxes between 5.5 and 2003
After I succesfully move a mailbox from a 5.5 server to a 2003 server it takes about 20-40 minutes for the client to be able to use the mailbox. OWA, Outlook and POP clients error out during this time but eventually everything works. Both servers are in the same site and org - is this normal? I am not sure how long it usually takes but the best way to do it is move mailboxes during none business hours. "Juraj Lisiak" <juraj@juraj.com> wrote in message news:ufSv2mTPFHA.1088@TK2MSFTNGP14.phx.gbl... > After I succesfully move a mailbox from a 5.5 server to a 2003 se...

Windows Live Mail #2
Ok, I've been a happy user of Outlook 2000 for a long time, but have liked what I see so far of the Vista version of Windows Mail. There is a similar version for XP called Windows Live Mail which looks the same. This may be OT, but as I am an Outlook user, maybe asking here may be helpful. My favorite features of Outlook are Rules, Calendar and Tasks. Are these features available for Live Mail or is there a plug-in? If not, I am happy with Outlook. Thanks. -- marx404 _________________ "marx404" in <news:g497t3$1sl$1@registered.motzarella.org> wrote: > Ok, I...

March 11th Windows Update and VBA (dis)functionality in Access
Folks, I've programmed an AccessXP database that makes extensive use of VBA module code called via Macro in response to form object events. Since yesterday's Office Security updates (multiple), a particular module function called via macro has begun to throw Microsoft Visual Basic Run-time error 2427 - You entered an expression that has no value. On debug, it jumps to the second in a series of about 6 If/Else statement in which the [Object].Value is tested for content. The first appears to work correctly, but commenting out the following 5 items one at a time causes the func...

Move mail
I had to reinstall windows and my outlook won't start i am going to have to reinstall it. Is there anyway to save certain files in microsoft office that I can move over so as not to loose my saved mail and my address book? Hi Bob, Which version of Outlook are you using? If you are using Outlook you can save all of your emails, contacts, etc. to a PST to do the move. However if you are using Outlook Express you will want to look at the following article: 257499 OLEXP: How to Move Mail Folders Between Two Computers that Are Running http://support.microsoft.com/?id=257499 HTH Regards...

Moving SQL Databases to another drive results in error
I am trying to move the CRM SQL Databases to another drive that has more space and I get a replication error. Is there any documentation to help me move these successfully?? McKenzie This is a multi-part message in MIME format. ------=_NextPart_000_005D_01C5A44F.29F39C90 Content-Type: text/plain; charset="Utf-8" Content-Transfer-Encoding: quoted-printable you can do this but you need to disable replication and re-enable = afterwards Use SQL Enterprise manager, select the database you want to move and = then=20 choose the option (after right click) to detach the database,then ...

Exchange 2003 and Windows 2003 SP2
Hi, Wondering if anyone has had problems with applying Windows 2003 SP2 on an Exchange 2003 SP2 server.. Thanks !!! -- On 11 Apr, 11:59, "Thinkpad21" <thinkpa...@yahoo.com> wrote: > Hi, > > Wondering if anyone has had problems with applying Windows 2003 SP2 on an > Exchange 2003 SP2 server.. > > Thanks !!! > > -- I applied it to my Exchange Server 2003 Standard almost three weeks ago now and have had no apparent problems - my Exchange Server is not heavily used just yet though, still pretty much trialling it with a small group. ...

Move incoming mail to another mailbox
Hi all! One of our employees is leaving the organisation. It is possible that we will be recieving mail on his address so we want to move all mail on former.employee@our.company to another mailbox. I would of course like to this on the server but I can't find any goodies about this in the system manager. Would also like to create an auto-reply on this email address stating that the employee no longer work for us. Thanks in advance. Regards - Jonas Sackerud Two choices as I see it: 1. Keep the mailbox and simply grant another user access to the mailbox so that new mail can be ch...

Explorer type Window Using MDI
Hi, i am new to MDI. i want to do an Explorer type window with an MDI Application.Means , one Treeview should be there at Left side and for each selection on the Treeitem ,a new child window has to be created(with Formview on the Right side). How i can create this fixed Treeview with in the Parent client area?. Please help me with some samples. Thank you for your time. -- shamrock ------------------------------------------------------------------------ Posted via http://www.codecomments.com ------------------------------------------------------------------------ > How i can create ...

OMA Security Exception
Please can someone help with this I believe the server updated itself from Windows Update by downloading a new version of the .net framework This has broken OMA which now gives the following error after logging in: Server Error in '/OMA' Application -------------------------------------------------------------------------------- Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level ...

Latest Windows Vista Update stops Outlook 2007 from working, Please help
Whenever the latest Windows Vista update is installed on my computer, Outlook 2007 doesn't work. It doesn't send and receive emails and when I click on 'New Email' I get an error message which says: "The messaging interface has returned an unknown error. If the problem persists, restart Outlook." The only way I can use Outlook is to use System Restore to 'undo' the last Windows update. But then it is constantly trying to force me to install the new update and I have to keep stopping it from uploading. This has wasted hours of my time. What can I do please? T...

LG monitor seems to have overwritten defaults for mouse click and desktop layout
Hi, I have searched before posting this query so apologies if I am treading over well worn territory. My Father has a Satellite Pro a120 running Vista. A while back he connected a 24" LG monitor and ever since then he's been having to reset his mouse click speed and reorganise his desktop icons every time he starts his laptop. The laptop has had performance issues since then too, often crashing. The laptop is a couple of years old and came with Vista, the monitor is about a year old. *Could it be a drivers issue?* Google'ing around I found a LG driver update dow...

I would Like to Receive the Windows Update Services for my Account
Thanks for your service... I would like to receive the Windows Updates for this acco unt at any time; please, take note about it. Thanks. -- FCAMPBELL01 Signatureship: ix/lc=1030 wcfla/lc=xxx-xx60310. fset/lc=xxx-xx25377. FCAMPBELL01 wrote: > Thanks for your service... I would like to receive the Windows > Updates for this acco > unt at any time; please, take note about it. I have taken note. Many others that are your peers likely will as well. However - I would bet the question would be, "Why should we care?" This is a peer-to-peer newsgroup - a foru...

Moving Reports Server
We currently have CRM, SQL and SRS on the same server. We would like to move SRS to a dedicated server. Would I need to setup the trust prior to running the Publishreports.exe? Thanks. Rob ...