X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8329e6c730f84bf55ad6c79b09756d662ebed39e..83498ef2b0a77944b3f7f3539b7bef6387c384a0:/src/os2/utilsgui.cpp

diff --git a/src/os2/utilsgui.cpp b/src/os2/utilsgui.cpp
index d5153224f1..46712f85f1 100644
--- a/src/os2/utilsgui.cpp
+++ b/src/os2/utilsgui.cpp
@@ -57,8 +57,6 @@ public:
     }
 };
 
-static wxTimer*                     wxTheSleepTimer = NULL;
-
 // Reading and writing resources (eg WIN.INI, .Xdefaults)
 #if wxUSE_RESOURCES
 bool wxWriteResource(
@@ -335,7 +333,6 @@ bool wxCheckForInterrupt(
         QMSG                        vMsg;
         HAB                         hab = 0;
         HWND                        hwndFilter = NULLHANDLE;
-        HWND                        hwndWin= (HWND) pWnd->GetHWND();
 
         while(::WinPeekMsg(hab, &vMsg, hwndFilter, 0, 0, PM_REMOVE))
         {
@@ -518,10 +515,12 @@ wxString WXDLLEXPORT wxGetWindowText(
 )
 {
     wxString                        vStr;
-    long                            lLen = ::WinQueryWindowTextLength((HWND)hWnd) + 1;
 
-    ::WinQueryWindowText((HWND)hWnd, lLen, vStr.GetWriteBuf((int)lLen));
-    vStr.UngetWriteBuf();
+    if ( hWnd )
+    {
+	long                lLen = ::WinQueryWindowTextLength((HWND)hWnd) + 1;
+	::WinQueryWindowText((HWND)hWnd, lLen, (PSZ)(wxChar*)wxStringBuffer(vStr, lLen));
+    }
 
     return vStr;
 }
@@ -531,22 +530,24 @@ wxString WXDLLEXPORT wxGetWindowClass(
 )
 {
     wxString                        vStr;
-    int                             nLen = 256; // some starting value
-
-    for ( ;; )
+    if ( hWnd )
     {
-        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;
+        int                         nLen = 256; // some starting value
+
+	for ( ;; )
+	{
+	    int                     nCount = ::WinQueryClassName((HWND)hWnd, nLen, (PSZ)(wxChar*)wxStringBuffer(vStr, nLen));
+
+	    if (nCount == nLen )
+	    {
+		// the class name might have been truncated, retry with larger
+		// buffer
+		nLen *= 2;
+	    }
+	    else
+	    {
+		break;
+	    }
         }
     }
     return vStr;
@@ -938,7 +939,7 @@ wxBitmap wxDisableBitmap(
     int                             j;
 
     //
-    // Bitmap must be ina double-word alligned address so we may
+    // Bitmap must be in a double-word aligned address so we may
     // have some padding to worry about
     //
     if (nLineBoundary > 0)