Autor Beitrag
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Mo 26.03.12 19:51 
Wichtige Lektion für Programmierer: RTFM - Read The F*ing Manual.

Wenn man mal den MSDN-Artikel zu GetSystemMetrics liest, findet man noch ein paar Abstände, die man addieren muss. Namentlich die DialogFrames, also der Teil "ganz außen", der den 3D-Eindruck erzeugt. Und die auf jeder Seite.

Damit das hier nicht nur Copy&Paste wird, Aufgabe für dich: selber finden und einbauen ;)

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
Premaider Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Mo 26.03.12 21:21 
Habe das ganze jetzt nochmal neu geschrieben, doch dann kommt immer ein Fehler.

Das Neue:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
var
 HWND:THandle;
 Breite:Integer;
 Hoehe:Integer;
 BorderWidth:Integer;
 BorderHeight:Integer;
begin
  BorderHeight:= 2 * GetSystemMetrics(SM_CXBORDER);
  BorderWidth:= GetSystemMetrics(SM_CYBORDER) + GetSystemMetrics(SM_CYCAPTION);
  Hoehe:= BorderHeight + SpinEdit1.Value;
  Breite:= BorderWidth + SpinEdit2.Value;
  HWND := FindWindow(nil, PChar(Edit1.Text));
  SetWindowPos(HWND,HWND_TOPMOST,0,0,Breite,Hoehe,SWP_NOMOVE);
end;


Der Fehler:
ausblenden Delphi-Quelltext
1:
[Fataler Fehler] Ausgabedatei 'C:\Users\Daniel\Desktop\Delphi Projekte\HelpTool\Project1.exe' kann nicht erstellt werden					


Was ist da los ?
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19274
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 26.03.12 21:28 
Wahrscheinlich läuft die Exe noch? :gruebel: Schau mal im Taskmanager.
Premaider Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Mo 26.03.12 21:31 
Es läuft auf jeden Fall nicht mehr. Im Taskmanager seh ich nichts :(
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19274
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 26.03.12 21:44 
Hast du den PC schon einmal neu gestartet?

Für diesen Beitrag haben gedankt: BenBE
Premaider Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Mo 26.03.12 21:58 
Werd ich. Wenn ich morgen um 5 von der Schule da bin :( wäre schön wenn bis dahin eine Lösung für das andere Problem gefunden wäre :D
Premaider Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Di 27.03.12 11:26 
Da ich gerade eine Freistunde habe, habe ich es nochmal neu geschrieben. Doch es bleibt wie es war. Er rechnet die Ränder nicht mit dazu :(
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19274
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Di 27.03.12 11:37 
Naja, wie sieht denn dein Quelltext aus?

Für diesen Beitrag haben gedankt: Premaider
Premaider Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Di 27.03.12 12:01 
So
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var
 HWND:THandle;
 Width:Integer;
 Height:Integer;
begin
  Width:= 1280 + 2 * GetSystemMetrics(SM_CXBORDER);
  Height:= 720 + GetSystemMetrics(SM_CYBORDER) + GetSystemMetrics(SM_CYCAPTION);
  HWND := FindWindow(nil, PChar(Edit1.Text));
  SetWindowPos(HWND,HWND_TOPMOST,0,0,Width,Height,SWP_NOMOVE);
end;


Und danke das du mir so konstant hilfst :D
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19274
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Di 27.03.12 13:36 
Womit wir wieder am Anfang dieser Seite der Diskussion angekommen wären...
user profile iconMartok hat folgendes geschrieben Zum zitierten Posting springen:
Wichtige Lektion für Programmierer: RTFM - Read The F*ing Manual.

Wenn man mal den MSDN-Artikel zu GetSystemMetrics liest, findet man noch ein paar Abstände, die man addieren muss. Namentlich die DialogFrames, also der Teil "ganz außen", der den 3D-Eindruck erzeugt. Und die auf jeder Seite.
Premaider Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Di 27.03.12 13:51 
Also ist der Aero Look von Win7 3D ?
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19274
Erhaltene Danke: 1740

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Di 27.03.12 14:00 
Ist es, ja, und vor allem handelt es sich um ein Fenster, das in der Größe verändert werden kann, [zaunpfahl=Baumstamm]also sizeable ist[/zaunpfahl].
Premaider Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Di 27.03.12 14:20 
Aber was ist wenn mein Programm jetzt auf einem OS ohne Aero ausgeführt wird wie WinXP dann geht das doch nicht mehr ?
€: Sieht jetzt so aus und geht auch nicht :(
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.Button1Click(Sender: TObject);
var
 HWND:THandle;
 Width:Integer;
 Height:Integer;
begin
  Width:= 1280 + 2 * GetSystemMetrics(SM_CXEDGE);
  Height:= 720 + 2 * GetSystemMetrics(SM_CYEDGE);
  HWND := FindWindow(nil, PChar(Edit1.Text));
  SetWindowPos(HWND,HWND_TOPMOST,0,0,Width,Height,SWP_NOMOVE);
end;
Premaider Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 51



BeitragVerfasst: Di 27.03.12 20:23 
Hat einer eine Idee warum das nicht funktioniert ? :(