Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. System Admin
  4. Service pack

Service pack

Scheduled Pinned Locked Moved System Admin
helptutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 423850
    wrote on last edited by
    #1

    Hello friends, The problem is i wanted to know how to get the SERVICE PACK installed on the Operating system PROGRAMATICALLY i am working in VC6 Enviroment. Please Please help me Thanx TAKE CARE

    A A 2 Replies Last reply
    0
    • U User 423850

      Hello friends, The problem is i wanted to know how to get the SERVICE PACK installed on the Operating system PROGRAMATICALLY i am working in VC6 Enviroment. Please Please help me Thanx TAKE CARE

      A Offline
      A Offline
      abhinarulkar
      wrote on last edited by
      #2

      Use GetVersionEx method and pass OSVERSIONINFOEX structure in it. This will return with all the OS environment on the system including service pack info. Hope it helps. Good Luck, Abhishek. Learning is a never ending process of Life.

      1 Reply Last reply
      0
      • U User 423850

        Hello friends, The problem is i wanted to know how to get the SERVICE PACK installed on the Operating system PROGRAMATICALLY i am working in VC6 Enviroment. Please Please help me Thanx TAKE CARE

        A Offline
        A Offline
        Atlantys
        wrote on last edited by
        #3

        Something like this:

        CString sOS;
        OSVERSIONINFO OSversion = {0};
        OSversion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
        ::GetVersionEx(&OSversion);
        switch (OSversion.dwPlatformId) {
            case VER\_PLATFORM\_WIN32s: 
        		sOS.Format(\_T("Windows %d.%d"),OSversion.dwMajorVersion,OSversion.dwMinorVersion);
        		break;
        	case VER\_PLATFORM\_WIN32\_WINDOWS:
        		if (OSversion.dwMinorVersion == 0) {
        			sOS=\_T("Windows 95");
        		} else {
        			if (OSversion.dwMinorVersion == 10) {
        				sOS=\_T("Windows 98");
        			} else {
        				if (OSversion.dwMinorVersion == 90) {
        					sOS=\_T("Windows ME");
        				}
        			}
        		}
        		break;        
        	case VER\_PLATFORM\_WIN32\_NT:
        		if (OSversion.dwMajorVersion == 5 && OSversion.dwMinorVersion == 0) {
        			sOS.Format(\_T("Windows 2000 with %s"),OSversion.szCSDVersion);
        		} else {
        			if (OSversion.dwMajorVersion == 5 && OSversion.dwMinorVersion == 1) {
        				sOS.Format(\_T("Windows XP %s"),OSversion.szCSDVersion);
        			} else {
        				if (OSversion.dwMajorVersion <= 4) {
        					sOS.Format(\_T("Windows NT %d.%d with %s"),OSversion.dwMajorVersion, OSversion.dwMinorVersion,OSversion.szCSDVersion);
        				} else { // for unknown windows/newest windows version
        					sOS.Format(\_T(Windows NT Unknown %d.%d with %s)),OSversion.dwMajorVersion, OSversion.dwMinorVersion);
        				}
        			}
        		}
        

        I prefer to wear gloves when using it, but that's merely a matter of personal hygiene [Roger Wright on VB] Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. [Rich Cook]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups