diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 18cd9ef682..3027b4f575 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1679,15 +1679,6 @@ static bool wxCheckWin32Permission(const wxString& path, DWORD access) return false; } - if ( wxGetOsVersion() == wxOS_WINDOWS_9X ) - { - // FAT directories always allow all access, even if they have the - // readonly flag set, and FAT files can only be read-only - return (dwAttr & FILE_ATTRIBUTE_DIRECTORY) || - (access != GENERIC_WRITE || - !(dwAttr & FILE_ATTRIBUTE_READONLY)); - } - HANDLE h = ::CreateFile ( path.t_str(), diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 0d6ed2f169..70f131f45b 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -2606,13 +2606,6 @@ bool wxFileName::SetTimes(const wxDateTime *dtAccess, int flags; if ( IsDir() ) { - if ( wxGetOsVersion() == wxOS_WINDOWS_9X ) - { - wxLogError(_("Setting directory access times is not supported " - "under this OS version")); - return false; - } - path = GetPath(); flags = FILE_FLAG_BACKUP_SEMANTICS; } diff --git a/src/msw/pen.cpp b/src/msw/pen.cpp index a41e4ddf83..843cc88c26 100644 --- a/src/msw/pen.cpp +++ b/src/msw/pen.cpp @@ -300,19 +300,6 @@ bool wxPenRefData::Alloc() const COLORREF col = m_colour.GetPixel(); #ifdef wxHAVE_EXT_CREATE_PEN - // Only NT can display dashed or dotted lines with width > 1 - static const int os = wxGetOsVersion(); - if ( os != wxOS_WINDOWS_NT && - (m_style == wxPENSTYLE_DOT || - m_style == wxPENSTYLE_LONG_DASH || - m_style == wxPENSTYLE_SHORT_DASH || - m_style == wxPENSTYLE_DOT_DASH || - m_style == wxPENSTYLE_USER_DASH) && - m_width > 1 ) - { - m_width = 1; - } - // check if it's a standard kind of pen which can be created with just // CreatePen() if ( m_join == wxJOIN_ROUND && diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index f275bb5c10..02f28bb566 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -1341,15 +1341,7 @@ bool wxTopLevelWindowMSW::SetTransparent(wxByte alpha) bool wxTopLevelWindowMSW::CanSetTransparent() { - // The API is available on win2k and above - - static int os_type = -1; - static int ver_major = -1; - - if (os_type == -1) - os_type = ::wxGetOsVersion(&ver_major); - - return (os_type == wxOS_WINDOWS_NT && ver_major >= 5); + return true; } void wxTopLevelWindowMSW::DoFreeze() diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 974534be61..93bc29b864 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -891,36 +891,33 @@ bool wxShutdown(int WXUNUSED_IN_WINCE(flags)) #else bool bOK = true; - if ( wxGetOsVersion(NULL, NULL) == wxOS_WINDOWS_NT ) // if is NT or 2K + // Get a token for this process. + HANDLE hToken; + bOK = ::OpenProcessToken(GetCurrentProcess(), + TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, + &hToken) != 0; + if ( bOK ) { - // Get a token for this process. - HANDLE hToken; - bOK = ::OpenProcessToken(GetCurrentProcess(), - TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, - &hToken) != 0; + TOKEN_PRIVILEGES tkp; + + // Get the LUID for the shutdown privilege. + bOK = ::LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, + &tkp.Privileges[0].Luid) != 0; + if ( bOK ) { - TOKEN_PRIVILEGES tkp; + tkp.PrivilegeCount = 1; // one privilege to set + tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; - // Get the LUID for the shutdown privilege. - bOK = ::LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, - &tkp.Privileges[0].Luid) != 0; + // Get the shutdown privilege for this process. + ::AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, + (PTOKEN_PRIVILEGES)NULL, 0); - if ( bOK ) - { - tkp.PrivilegeCount = 1; // one privilege to set - tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; - - // Get the shutdown privilege for this process. - ::AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, - (PTOKEN_PRIVILEGES)NULL, 0); - - // Cannot test the return value of AdjustTokenPrivileges. - bOK = ::GetLastError() == ERROR_SUCCESS; - } - - ::CloseHandle(hToken); + // Cannot test the return value of AdjustTokenPrivileges. + bOK = ::GetLastError() == ERROR_SUCCESS; } + + ::CloseHandle(hToken); } if ( bOK ) diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp index a0fbc92115..dedc3f547a 100644 --- a/src/msw/utilsexc.cpp +++ b/src/msw/utilsexc.cpp @@ -761,8 +761,7 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler, DWORD dwFlags = CREATE_SUSPENDED; #ifndef __WXWINCE__ - if ( (flags & wxEXEC_MAKE_GROUP_LEADER) && - (wxGetOsVersion() == wxOS_WINDOWS_NT) ) + if ( (flags & wxEXEC_MAKE_GROUP_LEADER) ) dwFlags |= CREATE_NEW_PROCESS_GROUP; dwFlags |= CREATE_DEFAULT_ERROR_MODE ; diff --git a/src/msw/window.cpp b/src/msw/window.cpp index a29b0b75bd..4ceb1b076c 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -917,22 +917,9 @@ void wxWindowMSW::WarpPointer(int x, int y) void wxWindowMSW::MSWUpdateUIState(int action, int state) { - // WM_CHANGEUISTATE only appeared in Windows 2000 so it can do us no good - // to use it on older systems -- and could possibly do some harm - static int s_needToUpdate = -1; - if ( s_needToUpdate == -1 ) - { - int verMaj, verMin; - s_needToUpdate = wxGetOsVersion(&verMaj, &verMin) == wxOS_WINDOWS_NT && - verMaj >= 5; - } - - if ( s_needToUpdate ) - { - // we send WM_CHANGEUISTATE so if nothing needs changing then the system - // won't send WM_UPDATEUISTATE - ::SendMessage(GetHwnd(), WM_CHANGEUISTATE, MAKEWPARAM(action, state), 0); - } + // we send WM_CHANGEUISTATE so if nothing needs changing then the system + // won't send WM_UPDATEUISTATE + ::SendMessage(GetHwnd(), WM_CHANGEUISTATE, MAKEWPARAM(action, state), 0); } // ---------------------------------------------------------------------------