Autor Beitrag
Gerhard
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Mi 25.02.04 19:58 
Hi,

wie kann man die Bildschirmeinstellung einstellen?

Danke Gerhard
Ich Bins
ontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 197

Win XP Prof
D5 Prof
BeitragVerfasst: Mi 25.02.04 22:25 
Hi, hab folgendes gefunden (nicht getestet):

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
Function ChangeResolution(sizex,sizey,bpp:DWORD):Boolean;
var
  DeviceMode:TDeviceModeA;
  i:Integer;
Begin
  i:=0;
  Result:=False;
  while EnumDisplaySettings(nil,i,DeviceMode) do begin
    with DeviceMode do
      if (dmPelsWidth=sizex) and 
         (dmPelsHeight=SizeY) and 
         (dmBitsPerPel=bpp) then begin
        // erst testen, bevor wir umschalten!
        case ChangeDisplaySettings(DeviceMode, CDS_TEST) of 
          // es wird klappen!
          DISP_CHANGE_SUCCESSFUL: 
            Result:=True;

          // Neustart erforderlich.
          DISP_CHANGE_RESTART:
            Showmessage('You have to restart'); 

          // Nicht unbedingt ein Fehler,
          DISP_CHANGE_BADFLAGS:
            Showmessage('Bad display mode flags');

          // es klappt nicht, ohne nähere Begründung
          DISP_CHANGE_FAILED:
            Showmessage('Failed in changing resolution');

          // diese Auflösung gibt es nicht
          DISP_CHANGE_BADMODE:
            Showmessage('Display mode not supported');

          // Nur Windows NT
          DISP_CHANGE_NOTUPDATED:
            Showmessage('Registry could not be updated');

        else Result:=true;
        end;

        if Result then 
          //jetzt wird umgeschaltet
          ChangeDisplaySettings(DeviceMode, CDS_FULLSCREEN)
      end;
    Inc(i);
  end;
End;


Aufruf erfolgt z.B. durch:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Button1Click(Sender: TObject);
begin
  ChangeResolution(1027,768,16);

end;

_________________
Diese Nachricht wurde mit einer Taschenlampe in das offenliegende Ende eines Glasfaserkabels gemorst!
Gerhard Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Do 26.02.04 18:44 
Danke,

ich werde den Sourcecode gleich testen.

Gruß Gerhard
Gerhard Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Fr 27.02.04 15:31 
Hi,

mit D3 funktioniert es nicht richtig ..... es wird zwar die Bildschirmeinstellung verändert, jedoch immer auf die gleiche?

Außerdem gibt es Probleme mit der Zeile
if (dmPelsWidth=sizex) and ..... mit dem "dmPelsWidth" geht es beim D3 nicht.


Vielleicht gibt es noch Lösungen?

Gruß Gerhard
elbrand
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Mo 01.03.04 12:45 
Titel: aufloesung
ich habs so gemacht - funktioniert eigentlich ...

www.kohnos.net/files/screenres/csr.dpr

bzw.

www.kohnos.net/files/screenres/csr.exe

_________________
-=siehe rueckseite=-