Start -- run -- winver.
Getversionex
Systemversion st;
Getversionex (...);
Enum win32type {win32s, winnt3, Win95, Win98, winme, winnt4, Win2000, WINXP };
Win32type isshelltype ()
{
Win32type shelltype;
DWORD winver;
Osversioninfo * osvi;
Winver = getversion ();
If (winver <0x80000000) {/* Nt */
Shelltype = winnt3;
Osvi = (osversioninfo *) malloc (sizeof (osversioninfo ));
If (osvi! = NULL ){
Memset (osvi, 0, sizeof (osversioninfo ));
Osvi-> dwosversioninfosize = sizeof (osversioninfo );
Getversionex (osvi );
If (osvi-> dwmajorversion = 4l) shelltype = winnt4;
Else if (osvi-> dwmajorversion = 5l & osvi-> dwminorversion = 0l) shelltype = Win2000;
Else if (osvi-> dwmajorversion = 5l & osvi-> dwminorversion = 1l) shelltype = WINXP;
Free (osvi );
}
}
Else if (lobyte (loword (winver) <4)
Shelltype = win32s;
Else {
Shelltype = Win95;
Osvi = (osversioninfo *) malloc (sizeof (osversioninfo ));
If (osvi! = NULL ){
Memset (osvi, 0, sizeof (osversioninfo ));
Osvi-> dwosversioninfosize = sizeof (osversioninfo );
Getversionex (osvi );
If (osvi-> dwmajorversion = 4l & osvi-> dwminorversion = 10l) shelltype = Win98;
Else if (osvi-> dwmajorversion = 4l & osvi-> dwminorversion = 90l) shelltype = winme;
Free (osvi );
}
}
Return shelltype;
}