-// Check whether this window wants to process messages, e.g. Stop button
-// in long calculations.
-bool wxCheckForInterrupt(
- wxWindow* pWnd
-)
-{
- if(pWnd)
- {
- QMSG vMsg;
- HAB hab = 0;
- HWND hwndFilter = NULLHANDLE;
- HWND hwndWin= (HWND) pWnd->GetHWND();
-
- while(::WinPeekMsg(hab, &vMsg, hwndFilter, 0, 0, PM_REMOVE))
- {
- ::WinDispatchMsg(hab, &vMsg);
- }
- return TRUE;//*** temporary?
- }
- else
- {
- wxFAIL_MSG(_T("pWnd==NULL !!!"));
- return FALSE;//*** temporary?
- }
-}
-
-void wxGetMousePosition(
- int* pX
-, int* pY
-)
-{
- POINTL vPt;
-
- ::WinQueryPointerPos(HWND_DESKTOP, &vPt);
- *pX = vPt.x;
- *pY = vPt.y;
-};
-
-// Return TRUE if we have a colour display
-bool wxColourDisplay()
-{
- HPS hpsScreen;
- HDC hdcScreen;
- LONG lColors;
-
- hpsScreen = ::WinGetScreenPS(HWND_DESKTOP);
- hdcScreen = ::GpiQueryDevice(hpsScreen);
- ::DevQueryCaps(hdcScreen, CAPS_COLORS, 1L, &lColors);
- return(lColors > 1L);
-}
-
-// Returns depth of screen
-int wxDisplayDepth()
-{
- HPS hpsScreen;
- HDC hdcScreen;
- LONG lPlanes;
- LONG lBitsPerPixel;
- LONG nDepth;
-
- hpsScreen = ::WinGetScreenPS(HWND_DESKTOP);
- hdcScreen = ::GpiQueryDevice(hpsScreen);
- ::DevQueryCaps(hdcScreen, CAPS_COLOR_PLANES, 1L, &lPlanes);
- ::DevQueryCaps(hdcScreen, CAPS_COLOR_BITCOUNT, 1L, &lBitsPerPixel);
-
- nDepth = (int)(lPlanes * lBitsPerPixel);
- DevCloseDC(hdcScreen);
- return (nDepth);
-}
-
-// Get size of display
-void wxDisplaySize(
- int* pWidth
-, int* pHeight
-)
-{
- HPS hpsScreen;
- HDC hdcScreen;
- LONG lWidth;
- LONG lHeight;
-
- hpsScreen = ::WinGetScreenPS(HWND_DESKTOP);
- hdcScreen = ::GpiQueryDevice(hpsScreen);
- ::DevQueryCaps(hdcScreen, CAPS_WIDTH, 1L, &lWidth);
- ::DevQueryCaps(hdcScreen, CAPS_HEIGHT, 1L, &lHeight);
- DevCloseDC(hdcScreen);
- *pWidth = (int)lWidth;
- *pHeight = (int)lHeight;
-}
-
-void wxDisplaySizeMM(
- int* pWidth
-, int* pHeight
-)
-{
- HPS hpsScreen;
- HDC hdcScreen;
-
- hpsScreen = ::WinGetScreenPS(HWND_DESKTOP);
- hdcScreen = ::GpiQueryDevice(hpsScreen);
-
- if (pWidth)
- ::DevQueryCaps( hdcScreen
- ,CAPS_HORIZONTAL_RESOLUTION
- ,1L
- ,(PLONG)pWidth
- );
- if (pHeight)
- ::DevQueryCaps( hdcScreen
- ,CAPS_VERTICAL_RESOLUTION
- ,1L
- ,(PLONG)pHeight
- );
-}
-
-void wxClientDisplayRect(int *x, int *y, int *width, int *height)
-{
- // This is supposed to return desktop dimensions minus any window
- // manager panels, menus, taskbars, etc. If there is a way to do that
- // for this platform please fix this function, otherwise it defaults
- // to the entire desktop.
- if (x) *x = 0;
- if (y) *y = 0;
- wxDisplaySize(width, height);
-}
-
-
-bool wxDirExists(
- const wxString& rDir
-)
-{
- return (::DosSetCurrentDir(WXSTRINGCAST rDir));
-}
-
-// ---------------------------------------------------------------------------
-// window information functions
-// ---------------------------------------------------------------------------
-
-wxString WXDLLEXPORT wxGetWindowText(
- WXHWND hWnd
-)
-{
- wxString vStr;
- long lLen = ::WinQueryWindowTextLength((HWND)hWnd) + 1;
-
- ::WinQueryWindowText((HWND)hWnd, lLen, vStr.GetWriteBuf((int)lLen));
- vStr.UngetWriteBuf();
-
- return vStr;
-}
-
-wxString WXDLLEXPORT wxGetWindowClass(
- WXHWND hWnd
-)
-{
- wxString vStr;
- int nLen = 256; // some starting value
-
- for ( ;; )
- {
- int nCount = ::WinQueryClassName((HWND)hWnd, nLen, vStr.GetWriteBuf(nLen));
-
- vStr.UngetWriteBuf();
- if (nCount == nLen )
- {
- // the class name might have been truncated, retry with larger
- // buffer
- nLen *= 2;
- }
- else
- {
- break;
- }
- }
- return vStr;
-}
-
-WXWORD WXDLLEXPORT wxGetWindowId(
- WXHWND hWnd
-)
-{
- return ::WinQueryWindowUShort((HWND)hWnd, QWS_ID);
-}
-
-wxString WXDLLEXPORT wxPMErrorToStr(
- ERRORID vError
-)