If I just use the Cpoint sent to OnMouseMove I get one
normal looking window, but positioned in the wrong place.
The tooltip window's ScreenToClient function appears to
generate an extra mousemove with each one that comes in
and then toggles the conversion between each, resulting in
two flashing windows in an eternal loop. This happens
even if I don't move the mouse.
Does anyone know what is going on here and how to fix it?
What am I doing wrong?
void CMyView::OnMouseMove(UINT nFlags, CPoint point)
{
ClientToScreen( &point );
m_pFlyvar->ScreenToClient( &point );
m_pFlyvar->SetWindowPos( &wndTop, point.x,
point.y, SIZE_X, SIZE_Y, SWP_NOACTIVATE|SWP_SHOWWINDOW );
// return; this doesn't change anything
CView::OnMouseMove(nFlags, point);
}
Thanks for any help,
landon
ClientToScreen( &point );
m_pFlyvar->GetParent()->ScreenToClient(&point);
m_pFlyVar->SetWindowPos(&wndTop, point.x, point.y, 0, 0,
SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW );
joe
On Sat, 20 Oct 2001 13:58:19 -0700, "landon" <lan...@aptech.com>
wrote:
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm
When I do, I get one flyvar window (thankfully), but it's
still in the wrong place. The ScreenToClient function
simply appears to be converting incorrectly... the output
coordinates are screen coordinates no matter where my view
window OR frame window is located.
If this isn't a bug in windows, then I'm still doing
something wrong. You have any more idea.. I'm getting
desperate.
Thanks again,
landon
>.
>
I first make the flyvar window a member variable of my
frame window and create it during my CMainFrame's
OnCreate. Then in the CView's OnCreate I make this call
to set the parent of the flyvar window the cview's parent:
m_pMainWnd->m_pFlyvar->SetParent( GetParent() );
After that, no conversion is necessary in my cView's
OnMouseMove. I just do the SetWindowPos using the CPoint
coming into the OnMousove.
Whew, what a round of battles this has been. Thanks for
your help Joe.
landon
>.
>
So, in OnActivate() I set the parent again to ensure the
flyvar window is associated with the correct view:
If ( bActivate )
{
m_pMainWnd->m_pFlyvar->SetParent( GetParent() );
}
But this causes all kinds of weirdness all over again.
The frame and the child view begin taking turns becoming
active all by themselves. The app is basically hung at
this point.
I'm exhausting all efforts trying to make this work. Any
help is greatly appreciated.
landon
>.
>
I did exactly this a week ago, except the windows also follow the
moving object they are associated with. But (a) I can't post images on
the newsgroup and (b) it isn't clear I have permission to display
anything that I was working on yet. So I know it works.
joe
On Sun, 21 Oct 2001 20:20:47 -0700, "landon" <lan...@aptech.com>
wrote:
ClientToScreen( pt );
m_WndFlyvar->GetParent()->ScreenToClient( pt );
The flyover now acts correctly within each view as it is
activated. However, the original problem still exists.
That is, though the flyover window is positioned correctly
relative to each view, it's completley ignoring the
position of the main frame window. Thus, when I move the
frame over and then move the mouse, the flyover window
follows the mouse in exactly the same positions as where
the frame was last.
Is it possible that you ran your tests in a maximized
frame window? If so, you would never have seen this
problem.
landon
>.
>
On Mon, 22 Oct 2001 09:15:14 -0700, "landon" <lan...@aptech.com>
wrote:
Ah yes, I see now. I was being stubborn in expecting the
View's ScreenToClient to adjust based on both it and the
frame window. (I guess I still think it's resonable but
time will likely help me see clearer).
This works perfectly Joe. Many thanks for not giving up
on me!
landon
>.
>
On Mon, 22 Oct 2001 13:19:57 -0700, "landon" <lan...@aptech.com>
wrote: