// In some mingws there is a missing extern "C" int the winsock header,
// so we put it here just to be safe. Note that this must appear _before_
-// #include "wx/msw/private.h" which itself includes <windows.h>, as this
+// #include "wx/msw/private.h" which itself includes <windows.h>, as this
// one in turn includes <winsock.h> unless we define WIN32_LEAN_AND_MEAN.
//
#if defined(__WIN32__) && !defined(__TWIN32__) && ! (defined(__GNUWIN32__) && !defined(__MINGW32__))
{
#if defined(__WIN32__)
DWORD attribs = GetFileAttributes(dir);
- return ((attribs != -1) && (attribs & FILE_ATTRIBUTE_DIRECTORY));
+ return ((attribs != (DWORD)-1) && (attribs & FILE_ATTRIBUTE_DIRECTORY));
#else // Win16
#ifdef __BORLANDC__
struct ffblk fileInfo;
case VER_PLATFORM_WIN32_WINDOWS:
str.Printf(_("Windows 9%c"),
- info.dwMinorVersion == 0 ? _T('5') : _T('9'));
+ info.dwMinorVersion == 0 ? _T('5') : _T('8'));
if ( !wxIsEmpty(info.szCSDVersion) )
{
str << _T(" (") << info.szCSDVersion << _T(')');
*majorVsn = info.dwMajorVersion;
if (minorVsn)
*minorVsn = info.dwMinorVersion;
-
+
switch ( info.dwPlatformId )
{
case VER_PLATFORM_WIN32s:
// Return TRUE if we have a colour display
bool wxColourDisplay()
{
- ScreenHDC dc;
- int noCols = GetDeviceCaps(dc, NUMCOLORS);
+ // this function is called from wxDC ctor so it is called a *lot* of times
+ // hence we optimize it a bit but doign the check only once
+ //
+ // this should be MT safe as only the GUI thread (holding the GUI mutex)
+ // can call us
+ static int s_isColour = -1;
+
+ if ( s_isColour == -1 )
+ {
+ ScreenHDC dc;
+ int noCols = ::GetDeviceCaps(dc, NUMCOLORS);
+
+ s_isColour = (noCols == -1) || (noCols > 2);
+ }
- return (noCols == -1) || (noCols > 2);
+ return s_isColour != 0;
}
// Returns depth of screen
if ( height ) *height = GetDeviceCaps(dc, VERTSIZE);
}
+void wxClientDisplayRect(int *x, int *y, int *width, int *height)
+{
+ // Determine the desktop dimensions minus the taskbar and any other
+ // special decorations...
+ RECT r;
+ SystemParametersInfo(SPI_GETWORKAREA, 0, &r, 0);
+ if (x) *x = r.left;
+ if (y) *y = r.top;
+ if (width) *width = r.right - r.left;
+ if (height) *height = r.bottom - r.top;
+}
+
// ---------------------------------------------------------------------------
// window information functions