UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

#1 2005-04-04 03:31 PM

lenna
Member
Registered: 2004-08-21
Posts: 77

Re: identify hardware

Hi guys,

I have an application that's running on different computers, so I want it to be able to adjust its operation according to the graphic card exist on each computer. kind of like:



if(getGraphicCard == X)
{...}
else
{...}





I know something regrading getting hardware information as folows:


int WINAPI WinMain(HINSTANCE h,HINSTANCE p,LPSTR l,int n)
{
	TCHAR szBuffer1[1000];
	TCHAR szBuffer2[1000];
	TCHAR szBuffer3[1000];
	
	TCHAR  infoBuf[INFO_BUFFER_SIZE];
	DWORD  bufCharCount = INFO_BUFFER_SIZE;
 
	// Get and display the name of the computer. 
	bufCharCount = INFO_BUFFER_SIZE;
	GetComputerName( infoBuf, &bufCharCount );
	/*if( !GetComputerName( infoBuf, &bufCharCount ) )
		printError( "GetComputerName" ); */
	sprintf(szBuffer3,  "Computer name:      %s", infoBuf ); 
	MessageBox(0, szBuffer3, "Computer Name", 0);

	HW_PROFILE_INFO HwProfInfo;
	GetCurrentHwProfile(&HwProfInfo) ;

	sprintf(szBuffer1, "DockInfo: %d", HwProfInfo.dwDockInfo);
	MessageBox(0, szBuffer1, "Dock Info", 0);

	sprintf(szBuffer2, "Profile Guid: %s", HwProfInfo.szHwProfileGuid);

	MessageBox(0, szBuffer2, "Profile Guid", 0);

	sprintf(szBuffer3, "Friendly Name: %s", HwProfInfo.szHwProfileName);

	MessageBox(0, szBuffer3, "Friendly Name", 0);

	int keyboardType = GetKeyboardType(0);

	sprintf(szBuffer3, "keyboard Type: %d", keyboardType);

	MessageBox(0, szBuffer3, "keyboard Type", 0);

	//GetSystemFileCacheSize
	//GetVersionEx - identify OS version



   SYSTEM_INFO siSysInfo;
 
   // Copy the hardware information to the SYSTEM_INFO structure. 
 
   GetSystemInfo(&siSysInfo); 
 
   // Display the contents of the SYSTEM_INFO structure. 

   sprintf(szBuffer3, "Hardware information:", 0);
   MessageBox(0, szBuffer3, "", 0);

   sprintf(szBuffer3, "OEM ID: %u", siSysInfo.dwOemId);
   MessageBox(0, szBuffer3, "OEM ID", 0);

   sprintf(szBuffer3, "Number of processors: %u", siSysInfo.dwNumberOfProcessors);
   MessageBox(0, szBuffer3, "Number of processors", 0);

   sprintf(szBuffer3, "Page size:  %u", siSysInfo.dwPageSize);
   MessageBox(0, szBuffer3, "Page size", 0);

   sprintf(szBuffer3, "Processor type:  %u", siSysInfo.dwProcessorType);
   MessageBox(0, szBuffer3, "Processor type", 0);

   sprintf(szBuffer3, "Minimum application address:  %lx", siSysInfo.lpMinimumApplicationAddress);
   MessageBox(0, szBuffer3, "Minimum application address", 0);

   sprintf(szBuffer3, "Maximum application address:  %lx", siSysInfo.lpMaximumApplicationAddress);
   MessageBox(0, szBuffer3, "Maximum application address", 0);

   sprintf(szBuffer3, "Active processor mask:  %u", siSysInfo.dwActiveProcessorMask);
   MessageBox(0, szBuffer3, "Active processor mask", 0);




but still don't know how to get graphic card info.

thanks for your help.

Offline

#2 2005-04-08 12:21 PM

mlampkin
Administrator
From: Sol 3
Registered: 2002-06-12
Posts: 911
Website

Re: identify hardware


"The only difference between me and a madman is that I'm not mad."

Salvador Dali (1904-1989)

Offline

Board footer

Powered by FluxBB