#include <windows.h>
#include <stdio.h>
int main()
{
HKEY bKey,hKey;
LONG retVal;
DWORD dwBuf = 1;
DWORD dwLen;
char SubKey[] = "System\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}";
char SubKeyValueName[] = "MediaSubType";
bKey = HKEY_LOCAL_MACHINE;
retVal = RegOpenKeyEx(bKey,SubKey,0,KEY_ALL_ACCESS,&hKey);
if(retVal!=ERROR_SUCCESS)
{
return -1;
}
RegQueryValueEx( bKey, SubKeyValueName, 0, 0, (LPBYTE)&dwBuf, &dwLen );
if ( dwBuf == 1 )
printf( "普通网卡\n " );
if ( dwBuf == 2 )
printf( "无线网卡\n " );
return 0;
}