How can PB2017 R2/EBF01 detect if the application is running on a Windows 10 platform?

1
0
-1

Hi,

Our environment is Win 7 32 and 64 bit, and Win 10 (64 bit).

We build our application in PB2017 R2/EBF01 on Win 7 for both 32 and 64 bit platforms.  We can detect whether it is running in 32 or 64 bit but we also need to detect if we are running on Win 10.

We currently check the Environment object ostype for an enumerated data type of WindowsNT! for an OsMinorRevision of Windows 7.

How is Win 10 detected?  Is Win 10 considered a major or minor revision and if so, is there a new value for it or is there a new enumerated data type for it?

Thanks in advance!

Pauline

Question Tags: 

Answers

Michael Kramer answered How can PB2017 R2/EBF01 detect if the application is running on a Windows 10 platform?

1
0
-1

When I run this snippet on Win10, I gett the following OS version

Environment myEnvironment
GetEnvironment(ref myEnvironment)
​// OSMajorRevision = 6
​// OSMinorRevision = 2

 

Also, TopWizProgramming.com has a free code example for OSVersion.

HTH /Michael

Michael Kramer's picture

... and running TopWiz's OSVersion app I see

OS: Windows 10
Edition: Professional
Bitness: 64
CSD: Fall Creator's Update (1709)

Setting a breakpoint in the code I see this version number (16299: Fall Creator's Update) :: Version = 10.0.16299.15

/Michael

Chris Pollach answered How can PB2017 R2/EBF01 detect if the application is running on a Windows 10 platform?

1
0
-1

Hi Pauline;

 

1) The Environment object in PB has a new property called "ProcessBitness" that will give you either a 32 or 64bit status of how your PB App is running.

2) The Environment object has not been updated yet to properly return the newer O/S versions. Instead, I use the "RtlGetversion" MS-Windows API command to retrieve the latest O/S versions.

FUNCTION uLong            RtlGetVersion ( ref sr_os_version  osver )  LIBRARY  "ntdll.dll"

HTH

Regards ... Chris

 

Roland's picture

RtlGetVersion is supposed to be used only by system drivers. User mode programs are supposed to use GetVersionEx which I use in my OSVersion example.

http://www.topwizprogramming.com/freecode_osversion.html

Chris Pollach's picture

Hi Roland;

  Thank you very mich for that updated information!   yes

Regards ... Chris

kberghall_15214's picture

getenvironment worked in PB 2017 R1, but is broken in R2. I'll report it as a bug.

Armeen Mazda's picture

Fix coming in the next MR, but please report the particular problem you found just in case.

adelem_30190's picture

HI,

I is the values

Environment myEnvironment
GetEnvironment(ref myEnvironment)
​// OSMajorRevision = 6
​// OSMinorRevision = 2

When I use PB2017/ R2

Regards

adelem_30190's picture

HI,

I is the values

Environment myEnvironment
GetEnvironment(ref myEnvironment)
​// OSMajorRevision = 6
​// OSMinorRevision = 2

When I use PB2017/ R2

Regards

adelem_30190's picture

HI,

I is the values

Environment myEnvironment
GetEnvironment(ref myEnvironment)
​// OSMajorRevision = 6
​// OSMinorRevision = 2

When I use PB2017/ R2

Regards

adelem_30190's picture

HI,

I is the values

Environment myEnvironment
GetEnvironment(ref myEnvironment)
​// OSMajorRevision = 6
​// OSMinorRevision = 2

When I use PB2017/ R2

Regards