Autor Beitrag
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Fr 19.09.03 13:11 
Hi,
wie kann ich die Auflösung unter Windows verändern? Und dazu auch noch mir der Farbtiefe.

Wie geht das?
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Fr 19.09.03 15:44 
hier ein code aus dem EDH2k:
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;

_________________
In the beginning was the word.
And the word was content-type: text/plain.