Fórum Mudando Resolução de Video #330904
09/10/2006
0
Ola pessoal.. estava pesquizando na net um rotima para quando se inciar meu programa ele auterar automaticamente a resolução de video
achei a seguinte rotina
procedure TFrmIrido.FormCreate(Sender: TObject);
begin
If (Screen.Width <> 1024)and(Screen.Height <> 768) then
if (messageDlg(´Este programa foi desenvolvido em 1024 X 768. Ele vai rodar normalmente nas suas confirações, mas não vai ficar posicionado corretamete em seu monitor! Deseja Alterar suas confirações de vídeo agora?´,
mtConfirmation, [mbYes, mbNo], 0)=mrYes) then
begin
OldWidth := GetSystemMetrics(SM_CXSCREEN);
OldHeight := GetSystemMetrics(SM_CYSCREEN);
SetScreenResolution(1024, 768);
Application.Terminate
end;
end;
{use este procedimento no On close}
procedure TFrmIrido.FormClose(Sender: TObject; var Action: TCloseAction);
begin
If (Screen.Width = 1024)and(Screen.Height = 768) then
begin
Case MessageBox(Handle,
Pchar(´Deseja retornar a resolução anterior ou seja, ´+#13+
´voltar para 800 x 600. Ele vai rodar normalmente ´+13+
´na confiração de 1024 x 768, mas não vai ficar posicionado ´+13+
´corretamete em seu monitor!´+13+
´Deseja Alterar suas confirações de vídeo agora?´),
´Deseja Alterar as Configurações de Vídeo!!´,
MB_ICONQUESTION+MB_YESNO)of
IDYES: Begin
OldWidth := GetSystemMetrics(SM_CXSCREEN);
OldHeight := GetSystemMetrics(SM_CYSCREEN);
SetScreenResolution(800, 600);
Halt;
end;
So tem um problema da erros pq tem funcções ai que no delphi não tem
essa e uma das
´OldWidth´
e eu nãos ei como fazer essa funcção roda sou leigo ainda em De´lphi alguem ai pode mim ajudar
vlw
achei a seguinte rotina
procedure TFrmIrido.FormCreate(Sender: TObject);
begin
If (Screen.Width <> 1024)and(Screen.Height <> 768) then
if (messageDlg(´Este programa foi desenvolvido em 1024 X 768. Ele vai rodar normalmente nas suas confirações, mas não vai ficar posicionado corretamete em seu monitor! Deseja Alterar suas confirações de vídeo agora?´,
mtConfirmation, [mbYes, mbNo], 0)=mrYes) then
begin
OldWidth := GetSystemMetrics(SM_CXSCREEN);
OldHeight := GetSystemMetrics(SM_CYSCREEN);
SetScreenResolution(1024, 768);
Application.Terminate
end;
end;
{use este procedimento no On close}
procedure TFrmIrido.FormClose(Sender: TObject; var Action: TCloseAction);
begin
If (Screen.Width = 1024)and(Screen.Height = 768) then
begin
Case MessageBox(Handle,
Pchar(´Deseja retornar a resolução anterior ou seja, ´+#13+
´voltar para 800 x 600. Ele vai rodar normalmente ´+13+
´na confiração de 1024 x 768, mas não vai ficar posicionado ´+13+
´corretamete em seu monitor!´+13+
´Deseja Alterar suas confirações de vídeo agora?´),
´Deseja Alterar as Configurações de Vídeo!!´,
MB_ICONQUESTION+MB_YESNO)of
IDYES: Begin
OldWidth := GetSystemMetrics(SM_CXSCREEN);
OldHeight := GetSystemMetrics(SM_CYSCREEN);
SetScreenResolution(800, 600);
Halt;
end;
So tem um problema da erros pq tem funcções ai que no delphi não tem
essa e uma das
´OldWidth´
e eu nãos ei como fazer essa funcção roda sou leigo ainda em De´lphi alguem ai pode mim ajudar
vlw
Maf_arthur
Curtir tópico
+ 0
Responder
Posts
13/10/2006
Ricardo_ascii
Ola pessoal.. estava pesquizando na net um rotima para quando se inciar meu programa ele auterar automaticamente a resolução de video
achei a seguinte rotina
procedure TFrmIrido.FormCreate(Sender: TObject);
begin
If (Screen.Width <> 1024)and(Screen.Height <> 768) then
if (messageDlg(´Este programa foi desenvolvido em 1024 X 768. Ele vai rodar normalmente nas suas confirações, mas não vai ficar posicionado corretamete em seu monitor! Deseja Alterar suas confirações de vídeo agora?´,
mtConfirmation, [mbYes, mbNo], 0)=mrYes) then
begin
OldWidth := GetSystemMetrics(SM_CXSCREEN);
OldHeight := GetSystemMetrics(SM_CYSCREEN);
SetScreenResolution(1024, 768);
Application.Terminate
end;
end;
{use este procedimento no On close}
procedure TFrmIrido.FormClose(Sender: TObject; var Action: TCloseAction);
begin
If (Screen.Width = 1024)and(Screen.Height = 768) then
begin
Case MessageBox(Handle,
Pchar(´Deseja retornar a resolução anterior ou seja, ´+#13+
´voltar para 800 x 600. Ele vai rodar normalmente ´+13+
´na confiração de 1024 x 768, mas não vai ficar posicionado ´+13+
´corretamete em seu monitor!´+13+
´Deseja Alterar suas confirações de vídeo agora?´),
´Deseja Alterar as Configurações de Vídeo!!´,
MB_ICONQUESTION+MB_YESNO)of
IDYES: Begin
OldWidth := GetSystemMetrics(SM_CXSCREEN);
OldHeight := GetSystemMetrics(SM_CYSCREEN);
SetScreenResolution(800, 600);
Halt;
end;
So tem um problema da erros pq tem funcções ai que no delphi não tem
essa e uma das
´OldWidth´
e eu nãos ei como fazer essa funcção roda sou leigo ainda em De´lphi alguem ai pode mim ajudar
vlw
Faço esse procedimento e da certo:
var
ScreenWidth : LongInt=640;
ScreenHeight : LongInt=480;
begin
scaled:=true;
if (screen.width <> screenWidth) then
begin
height := longInt(height) * longInt(screen.Height) div ScreenHeight;
width := longInt(width) * longInt(screen.Width) div ScreenWidth;
scaleBy(screen.width,ScreenWidth);
end;
end;
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)