Path: utzoo!utgpu!watserv1!watmath!att!att!rutgers!uwm.edu!cs.utexas.edu!uunet!microsoft!davidds From: davidds@microsoft.UUCP (David D'SOUZA) Newsgroups: comp.windows.ms.programmer Subject: Re: Tracking the mouse... Message-ID: <58753@microsoft.UUCP> Date: 3 Nov 90 20:38:05 GMT References: <5538@hsv3.UUCP> <823@tuura.UUCP> Reply-To: davidds@microsoft.UUCP (David D'SOUZA) Organization: Microsoft Corp., Redmond WA Lines: 19 In article <823@tuura.UUCP> risto@tuura.UUCP (Risto Lankinen) writes: >jls@hsv3.UUCP (James Seidman) writes: > > >>I'm trying to create a child window which can tell when the cursor goes in >>or out of it. The state of the window needs to be different depending on >>whether or not the cursor is currently inside it. > >>Now, figuring out when the mouse is inside it is easy, by capturing >>WM_MOUSEMOVE. However, figuring out when the mouse leaves the window >>is harder. Seems to me that whenever your child window gets the WM_MOUSEMOVE message you could capture the mouse (using SetCapture(hwndchild)). This would cause all mouse messages to go to your window regardless of where the mouse is. Now, when the mouse moves outside your window rectangle, you simply release the capture. --Dave