2009-10-13 5 views

Répondre

0

Et voici un exemple de quelque chose que je suis tombé récemment:

OSVERSIONINFO osvi; 

ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); 
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); 

GetVersionEx(&osvi); 
// use osvi.dwMajorVersion and osvi.dwMinorVersion 

Vous aurez besoin exécuter des tests pour vérifier à quelles versions les fenêtres correspondent. cela pourrait aider: http://en.wikipedia.org/wiki/History_of_Microsoft_Windows#Windows_NT

// (bad) example to check if we're running Windows XP 
if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) 
{ 
    // Windows XP 
} 
0

Si vous recherchez la productName + version marketing utilise, il est dans le registre:

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ Nom du produit

Regarder mon ordinateur, il dit "Windows 8.1 Pro".