]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/utils.cpp
SendSizeEvent() method moved from wxWindow to wxFrame, as that is the only place...
[wxWidgets.git] / src / msw / utils.cpp
index 2a9d0a99a4ed37c0c065ce1a9fa9aaa7eda030ea..f5217d22f960e6c2880672a406f61c4c6b94a6e4 100644 (file)
@@ -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?