]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/utils.cpp
Removed misleading text from wxDragImage doc
[wxWidgets.git] / src / msw / utils.cpp
index 0c647be3b590e45b615e08e03110a8739844517a..f5217d22f960e6c2880672a406f61c4c6b94a6e4 100644 (file)
@@ -457,6 +457,29 @@ bool wxDirExists(const wxString& dir)
 #endif // Win32/16
 }
 
+// ----------------------------------------------------------------------------
+// env vars
+// ----------------------------------------------------------------------------
+
+bool wxGetEnv(const wxString& var, wxString *value)
+{
+    // first get the size of the buffer
+    DWORD dwRet = ::GetEnvironmentVariable(var, NULL, 0);
+    if ( !dwRet )
+    {
+        // this means that there is no such variable
+        return FALSE;
+    }
+
+    if ( value )
+    {
+        (void)::GetEnvironmentVariable(var, value->GetWriteBuf(dwRet), dwRet);
+        value->UngetWriteBuf();
+    }
+
+    return TRUE;
+}
+
 bool wxSetEnv(const wxString& var, const wxChar *value)
 {
     // some compilers have putenv() or _putenv() or _wputenv() but it's better
@@ -550,7 +573,7 @@ wxString wxGetOsDescription()
 
             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(')');