Opened 11 months ago

Closed 11 months ago

Last modified 11 months ago

#16286 closed defect (fixed)

wxGetWinVersion() doesn't recognize Windows newer than Vista

Reported by: PB Owned by: VZ
Priority: normal Milestone:
Component: wxMSW Version: dev-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: yes

Description

Function wxGetWinVersion() doesn't recognize Windows newer than Vista.

As a side effect, new wxDirDialog using IFileDialog interface is never used after [76152].

I have attached a patch proposal but there are few issues with it I am aware of, for example:
Returning wxWinVersion_8_1 for any Windows with major version 6 and minor version higher than 3 is certainly not an ideal solution (such OS may not be ever released though). OTOH it still may be better than returning wxWinVersion_Unknown which may break code relying on conditions like this

if ( wxGetWinVersion() > wxWinVersion_Vista ) 

Regardless, any such code will break anyway for Windows with major version higher than 6, so...

Of course the whole situation with detecting Windows 8.1 is a bit more complicated.

Attachments (1)

wxGetVersion.patch download (1.5 KB) - added by PB 11 months ago.

Download all attachments as: .zip

Change History (5)

Changed 11 months ago by PB

comment:1 Changed 11 months ago by PB

  • Patch set

comment:2 Changed 11 months ago by vadz

Let's leave the whole issue of Windows 8.1+ for another time (we have #15321 for this) and just fix it for Windows 7 and 8 now.

Thanks for the patch!

comment:3 Changed 11 months ago by VZ

  • Owner set to VZ
  • Resolution set to fixed
  • Status changed from new to closed

In 76599:

Return wxWinVersion_[78] correctly from wxMSW wxGetWinVersion().

This is especially important because the workaround of r76152 for IFileDialog
bug under Windows Vista also applied under later Windows versions as they were
not detected correctly.

Closes #16286.

comment:4 Changed 11 months ago by VZ

In 76600:

Return wxWinVersion_[78] correctly from wxMSW wxGetWinVersion().

This is especially important because the workaround of r76152 for IFileDialog
bug under Windows Vista also applied under later Windows versions as they were
not detected correctly.

Closes #16286.

Note: See TracTickets for help on using tickets.