Click here to Skip to main content
15,885,757 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Simple Synchronization problem Pin
alex120517-Feb-04 16:46
alex120517-Feb-04 16:46 
Generalhelp in IE Pin
Abhi Lahare16-Feb-04 23:52
Abhi Lahare16-Feb-04 23:52 
GeneralRe: help in IE Pin
Ravi Bhavnani17-Feb-04 17:19
professionalRavi Bhavnani17-Feb-04 17:19 
GeneralDrawing problem while drawing on Flash Activex object Pin
Ricky Xian16-Feb-04 23:43
Ricky Xian16-Feb-04 23:43 
GeneralRe: Drawing problem while drawing on Flash Activex object Pin
basementman17-Feb-04 6:13
basementman17-Feb-04 6:13 
GeneralRetrieve Windows Version Pin
Member 81095316-Feb-04 23:38
Member 81095316-Feb-04 23:38 
GeneralRe: Retrieve Windows Version Pin
Prakash Nadar16-Feb-04 23:45
Prakash Nadar16-Feb-04 23:45 
GeneralRe: Retrieve Windows Version Pin
Selvam R16-Feb-04 23:48
professionalSelvam R16-Feb-04 23:48 
Hi,

This function return the Windows version,



LPTSTR CSystem::SystemVersion()<br />
{<br />
OSVERSIONINFOEX osvi;<br />
   BOOL bOsVersionInfoEx;<br />
  <br />
   ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));<br />
   osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);<br />
<br />
   GetVersionEx ((OSVERSIONINFO *) &osvi);<br />
  <br />
   TCHAR tchBuffer[800]; <br />
<br />
   switch (osvi.dwPlatformId)<br />
   {<br />
	     case VER_PLATFORM_WIN32_NT:<br />
<br />
        if ( osvi.dwMajorVersion <= 4 )<br />
            //printf( "Microsoft Windows NT ");<br />
			sprintf(tchBuffer, "Microsoft Windows NT "); <br />
<br />
         if ( osvi.dwMajorVersion == 5 )<br />
            //printf ("Microsoft Windows 2000 ");<br />
		 sprintf(tchBuffer, "Microsoft Windows 2000"); <br />
<br />
            HKEY hKey;<br />
            char szProductType[80];<br />
            DWORD dwBufLen;<br />
<br />
            RegOpenKeyEx( HKEY_LOCAL_MACHINE,<br />
               "SYSTEM\\CurrentControlSet\\Control\\ProductOptions",<br />
               0, KEY_QUERY_VALUE, &hKey );<br />
            RegQueryValueEx( hKey, "ProductType", NULL, NULL,<br />
               (LPBYTE) szProductType, &dwBufLen);<br />
            RegCloseKey( hKey );<br />
            if ( lstrcmpi( "WINNT", szProductType) == 0 )<br />
               //printf( "Workstation " );<br />
			   strcat(tchBuffer,"    Workstation ");<br />
            if ( lstrcmpi( "SERVERNT", szProductType) == 0 )<br />
               //printf( "Server " );<br />
			   strcat(tchBuffer,"    Server");<br />
<br />
         //"version %d.%d %s (Build %d)\n", osvi.dwMajorVersion, osvi.dwMinorVersion, osvi.szCSDVersion, osvi.dwBuildNumber & 0xFFFF);<br />
<br />
         break;<br />
<br />
      case VER_PLATFORM_WIN32_WINDOWS:<br />
<br />
         if ((osvi.dwMajorVersion > 4) || <br />
            ((osvi.dwMajorVersion == 4) && (osvi.dwMinorVersion > 0)))<br />
         {<br />
             //printf ("Microsoft Windows 98 ");<br />
			 sprintf(tchBuffer, "Microsoft Windows 98 "); <br />
         } <br />
         else //printf ("Microsoft Windows 95 ");<br />
				sprintf(tchBuffer, "Microsoft Windows 95 "); <br />
<br />
         break;<br />
<br />
      case VER_PLATFORM_WIN32s:<br />
<br />
         //printf ("Microsoft Win32s ");<br />
				sprintf(tchBuffer, "Microsoft Win32s "); <br />
         break;<br />
   }<br />
 <br />
 return tchBuffer;<br />
<br />
<br />
}





With Regards,
R.Selvam
GeneralRe: Retrieve Windows Version Pin
John M. Drescher17-Feb-04 2:51
John M. Drescher17-Feb-04 2:51 
Generalmessage box..... Pin
Best Friend16-Feb-04 22:55
Best Friend16-Feb-04 22:55 
GeneralRe: message box..... Pin
Prakash Nadar16-Feb-04 23:03
Prakash Nadar16-Feb-04 23:03 
GeneralRe: message box..... Pin
Selvam R16-Feb-04 23:07
professionalSelvam R16-Feb-04 23:07 
GeneralRe: message box..... Pin
Robert A. T. Káldy17-Feb-04 1:09
Robert A. T. Káldy17-Feb-04 1:09 
GeneralSocket problem... Pin
Prakash Nadar16-Feb-04 22:40
Prakash Nadar16-Feb-04 22:40 
GeneralRe: Socket problem... Pin
alex120516-Feb-04 23:11
alex120516-Feb-04 23:11 
GeneralRe: Socket problem... Pin
Prakash Nadar16-Feb-04 23:33
Prakash Nadar16-Feb-04 23:33 
QuestionHow to get good formatted text in Browser Control? Pin
vinjamsailendrachowdary16-Feb-04 22:35
vinjamsailendrachowdary16-Feb-04 22:35 
GeneralProblem with MessageBox Pin
JGStanier16-Feb-04 22:28
JGStanier16-Feb-04 22:28 
GeneralRe: Problem with MessageBox Pin
Prakash Nadar16-Feb-04 22:41
Prakash Nadar16-Feb-04 22:41 
GeneralRe: Problem with MessageBox Pin
JGStanier16-Feb-04 23:09
JGStanier16-Feb-04 23:09 
GeneralRe: Problem with MessageBox Pin
JGStanier16-Feb-04 23:16
JGStanier16-Feb-04 23:16 
GeneralRe: Problem with MessageBox Pin
Selvam R16-Feb-04 23:45
professionalSelvam R16-Feb-04 23:45 
GeneralRe: Problem with MessageBox Pin
JGStanier16-Feb-04 23:50
JGStanier16-Feb-04 23:50 
GeneralRe: Problem with MessageBox Pin
Prakash Nadar16-Feb-04 23:37
Prakash Nadar16-Feb-04 23:37 
GeneralRe: Problem with MessageBox Pin
JGStanier16-Feb-04 23:44
JGStanier16-Feb-04 23:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.