Verificar a resolução do video...

Delphi

23/09/2003

Olá,

Como faço para que o sistema antes de inicar verifique a resolução do video e as cores e retorne uma mensagem para o usuário...tipo assim :

Verifique :

Este programa necessita de resolução
800 x 600 e 256 cores.

Ou seja o sistema deverá verificar a resolução do video e só permitir se o mesmo estiver com 800x600 e 256 cores.

Grato,

Fábio Cavalcanti


Fccavalcanti

Fccavalcanti

Curtidas 0

Respostas

Sistemald

Sistemald

23/09/2003

Não sei se funciona, mais para saber a quantidade de cores tente esta função:

[b:05646332bf]var[/b:05646332bf]
hnd: THandle;
bitsPorPixel: integer;
[b:05646332bf]begin[/b:05646332bf]
hnd:= GetDC( Handle );
bitsPorPixel:= GetDeviceCaps( hnd, BITSPIXEL );
// 8 = 256 cores; 16 = high color; 24 = true color
[b:05646332bf]end;[/b:05646332bf]


GOSTEI 0
Nildo

Nildo

23/09/2003

E o tamanho da tela:
Screen.width // Largura
Screen.height // Altura


GOSTEI 0
Mmtoor

Mmtoor

23/09/2003

Vou te mandar um mel, mas incremente e use isso na abertura do seu form principal/

unit Unit1;

interface

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

type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
label1.caption := ´Largura:´ +inttostr(screen.width);
label2.caption :=´Altura:´ +inttostr(screen.Height);
end;

end.

MMTOOR2003


GOSTEI 0
POSTAR