Question and Answer Database FAQ2213C.txt How do I retrieve the Windows version in code? Category :Windows API Platform :All Product :C++Builder 1.x Question: How do I retrieve the Windows version in code? Answer: Here is an example: void __fastcall TForm1::Button1Click(TObject *Sender) { OSVERSIONINFO os; memset(&os, NULL, sizeof(OSVERSIONINFO)); os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&os); Memo1->Lines->Add(IntToStr(os.dwMajorVersion)); Memo1->Lines->Add(IntToStr(os.dwMinorVersion)); } 7/2/98 10:32:32 AM
Last Modified: 01-SEP-99