///////////////////////////////////////////////////////////////////////////////
-// Name: os2/utilsgui.cpp
+// Name: src/os2/utilsgui.cpp
// Purpose: Various utility functions only available in GUI
// Author: David Webster
// Modified by:
#endif
#ifndef WX_PRECOMP
- #include "wx/setup.h"
#include "wx/utils.h"
#include "wx/app.h"
#include "wx/cursor.h"
HAB hab = 0;
HINI hIni = 0;
- if (rFile != "")
+ if (!rFile.empty())
{
hIni = ::PrfOpenProfile(hab, (PSZ)WXSTRINGCAST rFile);
if (hIni != 0L)
wxChar zDefunkt[] = _T("$$default");
char zBuf[1000];
- if (rFile != "")
+ if (!rFile.empty())
{
hIni = ::PrfOpenProfile(hab, (PSZ)WXSTRINGCAST rFile);
if (hIni != 0L)
::DevCloseDC(hdcScreen);
::WinReleasePS(hpsScreen);
}
- *pWidth = (int)lWidth;
- *pHeight = (int)lHeight;
+ if (pWidth)
+ *pWidth = (int)lWidth;
+ if (pHeight)
+ *pHeight = (int)lHeight;
}
void wxDisplaySizeMM(
wxToolkitInfo & wxGUIAppTraits::GetToolkitInfo()
{
- static wxToolkitInfo vInfo;
+ static wxToolkitInfo vInfo;
ULONG ulSysInfo[QSV_MAX] = {0};
APIRET ulrc;
// window information functions
// ---------------------------------------------------------------------------
-wxString WXDLLEXPORT wxGetWindowText(
- WXHWND hWnd
-)
+wxString WXDLLEXPORT wxGetWindowText( WXHWND hWnd )
{
- wxString vStr;
- long lLen = ::WinQueryWindowTextLength((HWND)hWnd) + 1;
+ wxString vStr;
- ::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;
}
-wxString WXDLLEXPORT wxGetWindowClass(
- WXHWND hWnd
-)
+wxString WXDLLEXPORT wxGetWindowClass( WXHWND hWnd )
{
- wxString vStr;
- int nLen = 256; // some starting value
+ wxString vStr;
+ if ( hWnd )
+ {
+ int nLen = 256; // some starting value
for ( ;; )
{
- int nCount = ::WinQueryClassName((HWND)hWnd, nLen, vStr.GetWriteBuf(nLen));
+ int nCount = ::WinQueryClassName((HWND)hWnd, nLen, (PSZ)(wxChar*)wxStringBuffer(vStr, nLen));
- vStr.UngetWriteBuf();
if (nCount == nLen )
{
// the class name might have been truncated, retry with larger
{
break;
}
+ }
}
return vStr;
}
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)