-// 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
-)