***************************************************************** * Neveprise Inc. Delphi FAQ * ***************************************************************** * Section: Misc Topic: Check for coprocessor * * Created: July 27th, 1999 Revised: July 27th, 1999 * * Updates: www.neveprise.de Info: support@neveprise.de * ***************************************************************** Q: How can I check if the machine has a math coprocessor? A: To be open: most probably you will never need this function, cos all machines since Intel 80486 have it build in. Only in times where the 386 was common, it was useful to query and to make explicit calls to it, but nowadays, everyone has a math coporcessor in his computer (I hope...). No matter if the coprozessor is external or build in, it is labeled with an ending of 87, so the coprocessor of a 386 machine is called 387, from a 486 it is 487, a Pentium has 587 etc. So we simply query standard Windows parameters via calling GetWinFlags() and see if element Wf_80x87 is in it. If the call fails, we ask the Registry for it: function IsCoProcPresentH: boolean; {$IFDEF WIN32} var TheKey : hKey; {$ENDIF} begin Result := true; {$IFNDEF WIN32} if GetWinFlags and Wf_80x87 = 0 then Result := false; {$ELSE} if RegOpenKeyEx(HKEY_LOCAL_MACHINE,'HARDWARE\DESCRIPTION\System\FloatingPointProcessor',0,KEY_EXECUTE,TheKey)<>ERROR_SUCCESS then Result := false; RegCloseKey(TheKey); {$ENDIF} end; Blazko