Autor Beitrag
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Do 24.02.05 17:43 
Ich habe ein Programm geschrieben, dass sich ganz rechts an den Desktop "klebt". Meine Bildschirmauflösung ist 1280*1024!

Wenn ich nun aber das Programm auf'm rechner von nem kumpel ausführe, wird das programm nicht angezeigt. auf der taskbar erscheint zwar die schalftfläche aber das formular ist nicht zusehen.

Ich vermute, dass liegt an der auflösung vom kumpel, der hat nämlich 1024*786 oder so ähnlich.

Kann mir einer sagen, was ich ganz allgemein gesehen beachten muss, um solchen Problemen aus dem Weg zu gehen?

mfg kOller
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Do 24.02.05 17:44 
Ganz einfach:

1. Nicht für eine zu große Auflösung programmieren
2. Am besten gar nicht auflösungsfixiert programmieren...

AXMD
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Do 24.02.05 18:00 
versuch doch mit screen.width und height die auflösung zu bestimmen...?

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Do 24.02.05 18:38 
Hi,

versuch es mal auf diese Weise:

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:
Function ChangeResolution(sizex,sizey,bpp:DWORD):Boolean;
var  DeviceMode:TDeviceModeA;
     i:Integer;
Begin
  i:=0;            //Der Aufruf erfolgt z.B. über ChangeResolution(800,600,16).
  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

          DISP_CHANGE_SUCCESSFUL: Result:=True;  // es wird klappen!

          DISP_CHANGE_RESTART:    Showmessage('You have to restart');

          DISP_CHANGE_BADFLAGS:   Showmessage('Bad display mode flags');

          DISP_CHANGE_FAILED:     Showmessage('Failed in changing resolution');

          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  ChangeDisplaySettings(DeviceMode, CDS_FULLSCREEN)
      end;                    //jetzt wird umgeschaltet
    Inc(i);
  end;
End;

procedure TForm1.Button2Click(Sender: TObject);
begin  ChangeResolution(800,600,24);   end;

procedure TForm1.Button4Click(Sender: TObject);
begin  ChangeResolution(1024,768,24);  end;

procedure TForm1.Button3Click(Sender: TObject);
begin  ChangeResolution(1280,1024,16); end;


Grüße von

Detlef Annies

Moderiert von user profile iconMotzi: Delphi-Tags korrigiert.
Marc Walter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 40

Win98, WinXP
D2 Pers, D7 Pers
BeitragVerfasst: Do 24.02.05 18:51 
wie JayEff gesagt hat über screenwidth + -height die maximale Breite/Höhe bestimmen und dann halt das Fenster an stelle screenwidth-100 versetzen, falls dein Fenster 100 pixel breit is. so kannsches einfach immer an den Rand setzen lassen, glaub ich

_________________
möp