]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/utils.cpp
Hopefully fixed library names generated by wx-config for OS/2's PM port.
[wxWidgets.git] / src / msw / utils.cpp
index 365d1788409214d598f612a8168ade7aca6397de..3fea3de8d738f9eec4c13ccf3b04fdd6f44a12dd 100644 (file)
@@ -729,7 +729,7 @@ int wxKill(long pid, wxSignal sig, wxKillError *krc, int flags)
                 params.pid = (DWORD)pid;
 
                 // EnumWindows() has nice semantics: it returns 0 if it found
-                // something or if an error occured and non zero if it
+                // something or if an error occurred and non zero if it
                 // enumerated all the window
                 if ( !::EnumWindows(wxEnumFindByPidProc, (LPARAM)&params) )
                 {
@@ -738,7 +738,7 @@ int wxKill(long pid, wxSignal sig, wxKillError *krc, int flags)
                     {
                         // tell the app to close
                         //
-                        // NB: this is the harshest way, the app won't have
+                        // NB: this is the harshest way, the app won't have an
                         //     opportunity to save any files, for example, but
                         //     this is probably what we want here. If not we
                         //     can also use SendMesageTimeout(WM_CLOSE)
@@ -1045,9 +1045,9 @@ wxMemorySize wxGetFreeMemory()
 {
 #if defined(__WIN64__)
     MEMORYSTATUSEX memStatex;
-    statex.dwLength = sizeof (statex);
-    ::GlobalMemoryStatusEx (&statex);
-    return (wxMemorySize)memStatus.ullAvailPhys;
+    memStatex.dwLength = sizeof (memStatex);
+    ::GlobalMemoryStatusEx (&memStatex);
+    return (wxMemorySize)memStatex.ullAvailPhys;
 #else /* if defined(__WIN32__) */
     MEMORYSTATUS memStatus;
     memStatus.dwLength = sizeof(MEMORYSTATUS);
@@ -1241,6 +1241,62 @@ wxToolkitInfo& wxAppTraits::GetToolkitInfo()
     return info;
 }
 
+wxWinVersion wxGetWinVersion()
+{
+    int verMaj,
+        verMin;
+    switch ( wxGetOsVersion(&verMaj, &verMin) )
+    {
+        case wxWIN95:
+            if ( verMaj == 4 )
+            {
+                switch ( verMin )
+                {
+                    case 0:
+                        return wxWinVersion_95;
+
+                    case 10:
+                        return wxWinVersion_98;
+
+                    case 90:
+                        return wxWinVersion_ME;
+                }
+            }
+            break;
+
+        case wxWINDOWS_NT:
+            switch ( verMaj )
+            {
+                case 3:
+                    return wxWinVersion_NT3;
+
+                case 4:
+                    return wxWinVersion_NT4;
+
+                case 5:
+                    switch ( verMin )
+                    {
+                        case 0:
+                            return wxWinVersion_2000;
+
+                        case 1:
+                            return wxWinVersion_XP;
+
+                        case 2:
+                            return wxWinVersion_2003;
+                    }
+                    break;
+
+                case 6:
+                    return wxWinVersion_NT6;
+            }
+            break;
+
+    }
+
+    return wxWinVersion_Unknown;
+}
+
 // ----------------------------------------------------------------------------
 // sleep functions
 // ----------------------------------------------------------------------------
@@ -1478,7 +1534,7 @@ extern long wxCharsetToCodepage(const wxChar *name)
   Windows class unregistration).
 
   pclassname is a pointer to a caller stored classname, which must initially be
-  NULL. classname is the desired wndclass classname. If function succesfully
+  NULL. classname is the desired wndclass classname. If function successfully
   registers the class, pclassname will be set to classname.
  */
 extern "C" WXDLLIMPEXP_BASE HWND