Autor Beitrag
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Mi 06.09.06 19:42 
Hallo Freunde,

ich möchte gerade eine Funktion in mein Programm einbauen, die das MainForm nach dem Verschieben oder Größenändern immer wieder auf die Taskleiste sinken lässt.

Dazu brauche ich zwei Ereignisse, Resize bei Größenänderung gibt es ja schon. Aber ich brauche ein Ereignis, das eintritt, wenn das Fenster verschoben wurde.

Hoffentlich kann man sowas irgendwie machen, vielleicht mit einer WindowsMessage? Mir fällt dazu leider nichts ein...

Danke schon mal!
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mi 06.09.06 20:00 

_________________
We are, we were and will not be.
Jakob Schöttl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Mi 06.09.06 20:10 
Ahh, also tatsächlich mit WindowsMessages!

Gibts auch eine Liste oder Tabelle mit allen WMs?
//Edit: Ja, gibt es hier: www.autohotkey.com/d.../SendMessageList.htm

Danke Gausi!


Zuletzt bearbeitet von Jakob Schöttl am Mi 06.09.06 21:15, insgesamt 1-mal bearbeitet
Jakob Schöttl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Mi 06.09.06 21:11 
Das wars doch nicht ganz, das mit WM_WINDOWPOSCHANGED, weil das schon beim Programmstart 7 mal aufgerufen wurde, obwohl ich mir das nur in 2 Fällen erklären kann.

Aber was genau das richtige ist, das ist die Windows Message WM_EXITSIZEMOVE. Das wird eben immer aufgerufen, wenn man aufhört die Größe oder Position eines Forms zu ändern.
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mi 06.09.06 21:22 
Ist nicht von Mir und ungetestet aber vieleicht hilft es Dir eventuell.

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:
// Der folgende Code stellt fest, wann das Verschieben eines Fensters
// beendet ist. 

// Getestet mit D4 unter XP

... 
  public 
    { Public-Deklarationen } 
    procedure OnMoving(var aMsg: TMsg); message WM_MOVING; 
    procedure WMNCHittest(var Msg: TWMNCHittest); message WM_NCHittest; 
  end; 
 
var 
  Form1: TForm1; 
 
implementation 
 
{$R *.DFM} 
 
var 
  xx, yy: integer; 
  moveflag: boolean = false; 
 
procedure TForm1.OnMoving(var aMsg: TMsg); 
begin 
  inherited; 
  if visible and not moveflag then 
  begin 
    moveflag := true; 
    xx := left; 
    yy := top; 
  end; 
end; 
 
procedure TForm1.WMNCHittest(var msg: TWMNCHittest); 
begin 
  if moveflag then begin 
    if (left <> xx) or (top <> yy) 
      then // machwas, z.B.: 
      showmessage('Das Fenster wurde verschoben'); 
    moveflag := false; 
  end; 
  inherited; 
end;
Jakob Schöttl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Do 07.09.06 08:13 
Danke, aber ich habs ja schon geschafft:

user profile iconbokaj hat folgendes geschrieben:

Aber was genau das richtige ist, das ist die Windows Message WM_EXITSIZEMOVE. Das wird eben immer aufgerufen, wenn man aufhört die Größe oder Position eines Forms zu ändern.


Aber danke trotzdem :)