Code : Tout sélectionner
Procedure GetRegistryValue(hKey, lpSubKey.s, lpValueName.s)
#KEY_WOW64_64KEY = $100
If RegOpenKeyEx_(hKey, lpSubKey, ulOptions, #KEY_QUERY_VALUE | #KEY_WOW64_64KEY, @phkResult) = #ERROR_SUCCESS
If RegQueryValueEx_(phkResult, lpValueName, lpReserved, @lpType, #Null, @lpcbData) = #ERROR_SUCCESS
If lpcbData
*lpData = AllocateMemory(lpcbData)
RegQueryValueEx_(phkResult, lpValueName, lpReserved, @lpType, *lpData, @lpcbData)
EndIf
EndIf
RegCloseKey_(phkResult)
EndIf
ProcedureReturn *lpData
EndProcedure
Procedure.s CarteGraphique() ;Détermine la carte graphique installée
Global CarteGraphique.s
lpSubKey.s = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\WinSAT"
*lpData = GetRegistryValue(#HKEY_LOCAL_MACHINE, lpSubKey, "PrimaryAdapterString")
CarteGraphique = PeekS(*lpData) : FreeMemory(*lpData)
ProcedureReturn CarteGraphique
EndProcedure
Debug CarteGraphique()