#endif // !__WXWINCE__
+#ifdef __WXWINCE__
+// On Windows CE, GetCursorPos can return an error, so use this function
+// instead
+bool GetCursorPosWinCE(POINT* pt)
+{
+ DWORD pos = GetMessagePos();
+ pt->x = LOWORD(pos);
+ pt->y = HIWORD(pos);
+ return true;
+}
+#endif
+
// ---------------------------------------------------------------------------
// event tables
// ---------------------------------------------------------------------------
{
frame->SetLastFocus(NULL);
}
- break;
+
+ // apparently sometimes we can end up with our grand parent
+ // pointing to us as well: this is surely a bug in focus handling
+ // code but it's not clear where it happens so for now just try to
+ // fix it here by not breaking out of the loop
+ //break;
}
}
#endif // __WXUNIVERSAL__
// Change the cursor NOW if we're within the correct window
POINT point;
+#ifdef __WXWINCE__
+ ::GetCursorPosWinCE(&point);
+#else
::GetCursorPos(&point);
+#endif
RECT rect = wxGetWindowRect(hWnd);
{
// get the mouse position
POINT pt;
+#ifdef __WXWINCE__
+ ::GetCursorPosWinCE(&pt);
+#else
::GetCursorPos(&pt);
+#endif
// find the window which currently has the cursor and go up the window
// chain until we find this window - or exhaust it
// first ask the user code - it may wish to set the cursor in some very
// specific way (for example, depending on the current position)
POINT pt;
+#ifdef __WXWINCE__
+ if ( !::GetCursorPosWinCE(&pt) )
+#else
if ( !::GetCursorPos(&pt) )
+#endif
{
wxLogLastError(wxT("GetCursorPos"));
}
bool wxWindowMSW::HandleCtlColor(WXHBRUSH *brush, WXHDC hDC, WXHWND hWnd)
{
#if !wxUSE_CONTROLS || defined(__WXUNIVERSAL__)
- wxUnusedVar(pDC);
+ wxUnusedVar(hDC);
wxUnusedVar(hWnd);
#else
wxControl *item = wxDynamicCast(FindItemByHWND(hWnd, true), wxControl);
state |= MK_RBUTTON;
POINT pt;
+#ifdef __WXWINCE__
+ if ( !::GetCursorPosWinCE(&pt) )
+#else
if ( !::GetCursorPos(&pt) )
+#endif
{
wxLogLastError(_T("GetCursorPos"));
}
// translate the position to client coords
POINT pt;
+#ifdef __WXWINCE__
+ GetCursorPosWinCE(&pt);
+#else
GetCursorPos(&pt);
+#endif
RECT rect;
GetWindowRect(GetHwnd(),&rect);
pt.x -= rect.left;
wxPoint wxGetMousePosition()
{
POINT pt;
+#ifdef __WXWINCE__
+ GetCursorPosWinCE(&pt);
+#else
GetCursorPos( & pt );
+#endif
return wxPoint(pt.x, pt.y);
}