Solved

OS Version and Name

Posted on 2004-08-26
7
288 Views
Last Modified: 2013-11-17
I want to know how to I find out, using Builder c++ 6, the OS Version and Name.

So that way I can check if is running under windows 95, 98, 2000 or XP

I would like to retrive the os name - e.g. Windows 95 or Windows XP, the version if possible

If someboby can help if a sample code, will be nice

thanks.
0
Comment
Question by:torlani
  • 3
  • 2
  • 2
7 Comments
 
LVL 11

Accepted Solution

by:
Jase-Coder earned 30 total points
Comment Utility
I wrote something like that it delphi  here is the source

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1081&lngWId=7

open the .pas

It is in delphi but the code is easy to understand and it uses some windows API's
0
 

Author Comment

by:torlani
Comment Utility
I understad your code, but I try to implement in Builder and is not working, I not sure what do I have to do so builder will understad the "Win32Platform"

if someone can get a builder example, will help
0
 
LVL 11

Expert Comment

by:Jase-Coder
Comment Utility
Hi
I am, at the minute reconfiguring my whole system. I should have builder reinstalled tomorrow and i'll rewrite the code.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:torlani
Comment Utility
no problem ... Thanks again for the help
0
 
LVL 16

Assisted Solution

by:George Tokas
George Tokas earned 170 total points
Comment Utility
This is one way you can use:

OSVERSIONINFO   osinfo;
osinfo.dwOSVersionInfoSize = sizeof(osinfo);
GetVersionEx(&osinfo);

if(osinfo.dwPlatformId == VER_PLATFORM_WIN32s){}// Windows Win32s
if(osinfo.dwPlatformId == VER_PLATFORM_WINDOWS){}// Windows 9x
if(osinfo.dwPlatformId == VER_PLATFORM_WIN32_NT){}// Windows NT XP 2k....

osinfo is a structure.
accessing the dwMajorVersion & dwMinorVersion member you can find out if it is XP, 2k, 2003 etc.

gtokas.
0
 

Author Comment

by:torlani
Comment Utility
sorry gtokas, I mess up in clicking you as the accepted answer, but I gave you 170 points, so it should be ok ... I am sorry for that.
0
 
LVL 16

Expert Comment

by:George Tokas
Comment Utility
np...:-)

gtokas.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now