X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..585266618c27ac77a5e5316c03e06ffc514715c9:/src/msw/utils.cpp diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 14346f1413..634668dd77 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -436,29 +436,14 @@ wxChar *wxGetUserHome(const wxString& user) bool wxDirExists(const wxString& dir) { #if defined(__WIN32__) - WIN32_FIND_DATA fileInfo; + DWORD attribs = GetFileAttributes(dir); + return ((attribs != -1) && (attribs & FILE_ATTRIBUTE_DIRECTORY)); #else // Win16 #ifdef __BORLANDC__ struct ffblk fileInfo; #else struct find_t fileInfo; #endif -#endif // Win32/16 - -#if defined(__WIN32__) - HANDLE h = ::FindFirstFile(dir, &fileInfo); - - if ( h == INVALID_HANDLE_VALUE ) - { - wxLogLastError(wxT("FindFirstFile")); - - return FALSE; - } - - ::FindClose(h); - - return (fileInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; -#else // Win16 // In Borland findfirst has a different argument // ordering from _dos_findfirst. But _dos_findfirst // _should_ be ok in both MS and Borland... why not? @@ -951,6 +936,8 @@ wxChar *wxLoadUserResource(const wxString& resourceName, const wxString& resourc // get display info // ---------------------------------------------------------------------------- +// See also the wxGetMousePosition in window.cpp +// Deprecated: use wxPoint wxGetMousePosition() instead void wxGetMousePosition( int* x, int* y ) { POINT pt; @@ -984,6 +971,15 @@ void wxDisplaySize(int *width, int *height) if ( height ) *height = GetDeviceCaps(dc, VERTRES); } +void wxDisplaySizeMM(int *width, int *height) +{ + ScreenHDC dc; + + if ( width ) *width = GetDeviceCaps(dc, HORZSIZE); + if ( height ) *height = GetDeviceCaps(dc, VERTSIZE); +} + + // --------------------------------------------------------------------------- // window information functions // ---------------------------------------------------------------------------