> It sounds like you're trying to do this in a fairly awkward way. You might
> want to consider using something like...
> Private Function IsPointerOverWindow(Optional ByVal WhichWindow As Long) As
> Boolean
> If WhichWindow = 0 Then
> ' Set default
> WhichWindow = Me.HWnd
> End If
> Dim Window As Long
> Dim PT As POINTAPI
> GetCursorPos PT
> Window = WindowFromPoint(PT.X, PT.Y)
> If WhichWindow = Window Then
> ' Window is the form
> IsPointerOverWindow = True
> ElseIf IsChild(WhichWindow, Window) Then
> ' Window is a child
> IsPointerOverWindow = True
> End If
> End Function
> If you call this function from within a form (without passing a parameter),
> it will return True if the pointer is over the form.
> Murphy McCauley
> www.fullspectrum.com/deeth
> >Hi All,
> >I'm using Paul Kuliniewicz's (vbapi.com) handy solution for detecting
> >the window title based on the position of the mouse pointer, especially
> >when the VB app doesn't have the focus. I'm using this technique to
> >shrink my app's form size when the mouse is detected off the form, and
> >to enlarge it when it's on the form.
> >Unfortunately, all controls on my form have no window title, i.e. only
> >when the mouse is over the form (or title bar) itself is the form's
> >title returned; otherwise a blank title name is returned. So I've
> >resorted to enlarging my form when when the window name is "My App" or
> >when it's "". Well, several mouse positions also create a null window
> >title: the Task Bar, the Tray Menu, application Menus, etc. so app
> >unexpectedly enlarges.
> >How can I truly detect when the mouse position is anywhere over my form?
> >TIA,
> >Simon