GE window MFC application Wrong of the mouse left click position!

9 views
Skip to first unread message

bopi

unread,
Jun 28, 2011, 5:24:15 AM6/28/11
to Google Earth API
I use the GE COM API to develop a MFC application in VS 2008 with sp1
in C++;
I use the code like this:
//The Window Size
CRect mRect;
GetClientRect(&mRect);

//The Size of GE main window
CRect mainRect;
::GetWindowRect(m_hMainWnd,&mainRect);

//The size of GE render window handle
CRect clientRect;

::GetClientRect((HWND)g_gEApp.GetRenderHwnd(),clientRect);

offsetW = mainRect.Width() - clientRect.Width();
offsetH = mainRect.Height() - clientRect.Height();

//Set the main window size of GE
::SetWindowPos(m_hMainWnd, HWND_TOP,0,0,mRect.Width() +
offsetW,mRect.Height()+offsetH, SWP_FRAMECHANGED);

//移动窗口,Move the window to size
::MoveWindow(m_hMainWnd,0,0,mRect.Width()+ offsetW,mRect.Height()
+offsetH,TRUE);
::SetParent((HWND)m_hMainWnd, GetSafeHwnd());
it works. you can see the image:
http://images.cnblogs.com/cnblogs_com/bopi/307332/o_Question01.jpg
But the question is:
When I use the mouse to select the Location or Layer, It gets the
wrong item.
When Left Click in the first Item, It Choose the third or the forth
Item.
What is the problem? How can I resolve it!
Thanks!
Reply all
Reply to author
Forward
0 new messages