+ HDC hDc = ::WinOpenWindowDC((HWND)NULL);
+ long lArray[CAPS_HEIGHT];
+
+ if(DevQueryCaps( hDc
+ ,CAPS_FAMILY
+ ,CAPS_HEIGHT
+ ,lArray
+ ))
+ {
+ *width = (int)lArray[CAPS_WIDTH];
+ *height = (int)lArray[CAPS_HEIGHT];
+ }
+ DevCloseDC(hDc);
+}
+
+bool wxDirExists(const wxString& dir)
+{
+ // TODO: Control program file stuff
+ return TRUE;
+}
+
+// ---------------------------------------------------------------------------
+// window information functions
+// ---------------------------------------------------------------------------
+
+wxString WXDLLEXPORT wxGetWindowText(WXHWND hWnd)
+{
+ wxString str;
+ long len = ::WinQueryWindowTextLength((HWND)hWnd) + 1;
+ ::WinQueryWindowText((HWND)hWnd, len, str.GetWriteBuf((int)len));
+ str.UngetWriteBuf();
+
+ return str;
+}
+
+wxString WXDLLEXPORT wxGetWindowClass(WXHWND hWnd)
+{
+ wxString str;
+
+ int len = 256; // some starting value
+
+ for ( ;; )
+ {
+ int count = ::WinQueryClassName((HWND)hWnd, len, str.GetWriteBuf(len));
+
+ str.UngetWriteBuf();
+ if ( count == len )
+ {
+ // the class name might have been truncated, retry with larger
+ // buffer
+ len *= 2;
+ }
+ else
+ {
+ break;
+ }
+ }
+ return str;
+}
+
+WXWORD WXDLLEXPORT wxGetWindowId(WXHWND hWnd)
+{
+ return ::WinQueryWindowUShort((HWND)hWnd, QWS_ID);