Tema: Detectar GPU
Ver Mensaje Individual
  #6  
Antiguo 28-08-2010
madiazg madiazg is offline
Miembro
 
Registrado: sep 2005
Ubicación: Canarias
Posts: 120
Reputación: 19
madiazg Va por buen camino
Hola,
ya he podido utilizar los componentes en TurboDelphi. Yo utilizo el TDisplayInfo:

He tenido que añadir al directorio de la aplicación:
  • CDisplayInfo.pas
  • CWMIBase.pas
  • FormAbout.dfm
  • FormAbout.pas
  • UConstantes.pas
  • UProcedures.pas
  • WbemScripting_TLB.pas
Un pequeño ejemplo:

Código:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,CDisplayInfo;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Memo1: TMemo;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  GPU : TDisplayInfo;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  Memo1.Lines.Add('DeviceName: ' + GPU.DisplayProperties.DeviceName);
  Memo1.Lines.Add('Caption: ' + GPU.DisplayProperties.Caption);
  Memo1.Lines.Add('Description: ' + GPU.DisplayProperties.Description);
  Memo1.Lines.Add('DitherTypeAsString: ' + GPU.DisplayProperties.DitherTypeAsString);
  Memo1.Lines.Add('DriverVersion: ' + GPU.DisplayProperties.DriverVersion);
  Memo1.Lines.Add('SettingID: ' + GPU.DisplayProperties.SettingID);
  Memo1.Lines.Add('Height: ' + inttoStr(GPU.DisplayProperties.PelsHeight));
  Memo1.Lines.Add('Width: ' + inttoStr(GPU.DisplayProperties.PelsWidth));
  Memo1.Lines.Add('DisplayFrequency: ' + inttostr(GPU.DisplayProperties.DisplayFrequency));
  Memo1.Lines.Add('SpecificationVersion: ' + inttostr(GPU.DisplayProperties.SpecificationVersion));
end;

procedure TForm1.FormCreate(Sender: TObject);
var
  error : boolean;
begin
  GPU := TDisplayInfo.Create(nil);
  GPU.Active := True;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  GPU.Free;
end;

end.
Saludos...
Miguel Angel
Responder Con Cita