Autor Beitrag
Cruiser23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: Fr 18.07.03 09:23 
Suche nach einer Möglichkeit, die BorderIcons mitsammt Titelleiste auszublenden und dann die Funktionen auf Buttons zu legen. Titelleiste ausblenden is nicht das Problem, nur stelle ich nun fest, das wenn ich mein Prog minimire, es dann restore und dann wieder minimiren will, es nicht mehr will( soll heißen: es lässt sich nicht mehr minimiren. Weiß wer Rat?

//Edit: Habe es nun mit IsIconic() und IsZoomed() gemacht! Nu funtzts !!!
DANKE MOTZI :beer:

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!


Zuletzt bearbeitet von Cruiser23 am Mo 21.07.03 17:23, insgesamt 2-mal bearbeitet
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Fr 18.07.03 09:27 
Was willst du denn machen? Deine eigene Titelleiste erstellen? Mit welchem Code arbeiten deine neuen BorderIcons?

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Cruiser23 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: Fr 18.07.03 09:43 
Genau das! Habe den Code dafür im Ease Delphi Helper 2000 gefunden. Wenn mein Prog neu gestartet wird, wird eine var auf false gesetzt, die beim minimiren wieder auf true gesetzt wird und bei restore wieder auf false. Eigentlich müsste es klappen, aber tuts nich! Werde wohl aml wieder nen Saudummen Fehler gemacht haben (oder was vergessen ?!) :
ausblenden 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:
var
  Form1: TForm1;
  MinTrue: Boolean;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  h:HWnd;

  begin
    if MinTrue then
      begin
        ShowMessage('Ist bereits minimiert!');
      end
      else begin
        h:=handle;
        postmessage(h,WM_SYSCOMMAND,SC_MINIMIZE,0);
        MinTrue := false;
      end;
   end;

initialization
  MinTrue := false;

  end.

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Fr 18.07.03 10:15 
Lass das mit der Boolean-Variable weg (angenommen irgendwer minimiert dein Fenster per ShowWindow - dann ist es zwar minimiert aber MinTrue ist false.. oder umgekehrt dein Fenster wird von außerhalb restored - dann ist es zwar restored, aber MinTrue ist true)! Es reichen nur die Aufrufe von PostMessage/SendMessage mit WM_SYSCOMMAND und dem jeweiligen SC_* Parameter...

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Cruiser23 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: Sa 19.07.03 13:54 
Wie kann ich den feststellen ob mein Prog nun mini, maxi oder restort wird (von außerhalb)? Müsste doch ne Funktion geben, die mir ne das in irgend ner art zurück gibt (entweder eine, die von selbst meldet wenn man zugreift und dann das passende meldet, oder eine, die die ich mittels Timer immer wieder abfragen kann)?
Mit aufruf Beispiel wäre nett (da ich mich noch nicht so gut auskenne), oder nem Hinweiß wonach ich suchen sollte.

// Edit: bzw. eine die ich mit OnRezise überprüfen kann!

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Sa 19.07.03 17:35 
IsIconic() -> minimiert?
IsZoomed() -> maximiert?

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Terra23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: Sa 19.07.03 19:17 
@Cruiser: Auch wenn ich davon wirklich keine Ahnung habe, aber ist es nicht unlogisch?

Wenn dein Programm minimiert ist, wie kann denn noch der User auf den Knopf drücken, der das Tool minimieren soll? Ich meine, ich kann mich auch irren und irren ist ja menschlich. :-)

_________________
Hasta La Victoria Siempre
Cruiser23 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: Sa 19.07.03 20:04 
@Terra: Stimmt schon, geht im eigendlichen um mein Problem das sich bei der ausführung von
Zitat:
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:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
procedure TForm1.MinForm; 
var 
  h:HWnd; 

  begin 
    if MinTrue = false then 
       begin 
        TaskBarAddIcon; 
        h:=handle; 
        postmessage(h,WM_SYSCOMMAND,SC_MINIMIZE,0); 
        MinTrue:= true; 
      end 
    else 
     Showmessage('Ist minimiert'); 
     Exit; 
  end

procedure TForm1.TaskBarAddIcon; 
var 
  tnid: TNotifyIconData ; 

  begin 
    with tnid do 
      begin 
        cbSize := sizeof(TNotifyIconData); 
        Wnd := Form1.handle; 
        uID := 1
        uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP; 
        uCallbackMessage := WM_TASKBAREVENT; 
        hIcon := application.icon.handle; 
        strcopy(tnid.szTip,'Tooltipp'); 
        Shell_NotifyIcon(NIM_ADD, @tnid); 
        with Screen do 
          DrawAnimatedRects(Handle, 
                                 3
                            BoundsRect, 
                            Rect(Width-20, Height, Width-10, Height)); 


      end
  end

procedure TForm1.WMTASKBAREVENT(var message: TMessage); 
var 
  MP: TPoint; 

  begin 
    case message.LParamLo of 
      WM_RBUTTONDOWN    : begin 
                            GetCursorPos(MP); 
                            //SetForeGroundWindow(Form1.Handle); 
                            SystrayPopup.Popup(MP.x,MP.y);                         end
      WM_LBUTTONDBLCLK  : begin 
                            Anzeigen1Click(nil); 
                          end
    end
  end

procedure TForm1.MinForm; 
var 
  h:HWnd; 

  begin 
    if MinTrue = false then 
      begin 
        TaskBarAddIcon; 
        h:=handle; 
        postmessage(h,WM_SYSCOMMAND,SC_MINIMIZE,0); 
        MinTrue:= true; 
      end 
    else 
     Showmessage('Ist minimiert'); 
     Exit; 
  end;

Wenn mein prog einmal minimiret ist, läss es sich (nach dem Restore) kein zweites mal minimiren! Was habe ich falsch gemacht?
Weiß den niemand einen Rat :autsch:
diesem code ergibt...!

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!