///////////////////////////////////////////////////////////////////////////////
-// 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;
+ wxString vStr;
if ( hWnd )
{
- long lLen = ::WinQueryWindowTextLength((HWND)hWnd) + 1;
- ::WinQueryWindowText((HWND)hWnd, lLen, (PSZ)(wxChar*)wxStringBuffer(vStr, lLen));
+ 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;
+ wxString vStr;
if ( hWnd )
{
- 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;
- }
+ 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;