git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33574
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
+#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
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// event tables
// ---------------------------------------------------------------------------
// Change the cursor NOW if we're within the correct window
POINT point;
// Change the cursor NOW if we're within the correct window
POINT point;
+#ifdef __WXWINCE__
+ ::GetCursorPosWinCE(&point);
+#else
RECT rect = wxGetWindowRect(hWnd);
RECT rect = wxGetWindowRect(hWnd);
{
// get the mouse position
POINT pt;
{
// get the mouse position
POINT pt;
+#ifdef __WXWINCE__
+ ::GetCursorPosWinCE(&pt);
+#else
// find the window which currently has the cursor and go up the window
// chain until we find this window - or exhaust it
// 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;
// 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) )
if ( !::GetCursorPos(&pt) )
{
wxLogLastError(wxT("GetCursorPos"));
}
{
wxLogLastError(wxT("GetCursorPos"));
}
state |= MK_RBUTTON;
POINT pt;
state |= MK_RBUTTON;
POINT pt;
+#ifdef __WXWINCE__
+ if ( !::GetCursorPosWinCE(&pt) )
+#else
if ( !::GetCursorPos(&pt) )
if ( !::GetCursorPos(&pt) )
{
wxLogLastError(_T("GetCursorPos"));
}
{
wxLogLastError(_T("GetCursorPos"));
}
// translate the position to client coords
POINT pt;
// translate the position to client coords
POINT pt;
+#ifdef __WXWINCE__
+ GetCursorPosWinCE(&pt);
+#else
RECT rect;
GetWindowRect(GetHwnd(),&rect);
pt.x -= rect.left;
RECT rect;
GetWindowRect(GetHwnd(),&rect);
pt.x -= rect.left;
wxPoint wxGetMousePosition()
{
POINT pt;
wxPoint wxGetMousePosition()
{
POINT pt;
+#ifdef __WXWINCE__
+ GetCursorPosWinCE(&pt);
+#else
return wxPoint(pt.x, pt.y);
}
return wxPoint(pt.x, pt.y);
}