function EnumDisplaySettings(lpszDeviceName: LPCWSTR; iModeNum: DWORD;
var lpDevMode: DEVMODEW): BOOL; stdcall; forward;
function EnumDisplaySettings; external 'user32.dll' name 'EnumDisplaySettingsW';
procedure TForm1.Button1Click(Sender: TObject);
var
lpszDeviceName: LPCWSTR;
iModeNum: DWORD;
lpDevMode: DEVMODEW;
begin
EnumDisplaySettings(nil,$FFFFFFFF,lpDevMode);
caption := inttostr(lpDevMode.dmBitsPerPel);
end;