Autor Beitrag
Biarchiv
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 688



BeitragVerfasst: Do 24.06.04 07:04 
Hallo,

habe folgenden Code unter P.i.c.s gefunden.
Dieser Code versteckt das Program in der Taskleiste auch wenn es heruntergelegt wird.
Frage im Code.
Habe Delphi3;

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure WMSysCommand(var Message: TWMSysCommand); message
WM_SysCommand;
// Hier schreibt er das der Kommand falsch ist.
// Wenn ich das letzte weg lasse dann geht es nicht, dass das Programm
// in der Task auch nach einem herunterlegen versteckt wird.
// procedure WMSysCommand(var Message: TWMSysCommand);


procedure TMainForm.WMSysCommand(var Message: TWMSysCommand);
begin
  if Message.CmdType and $FFF0 = SC_MINIMIZE then
    Hide
  else
    inherited;
end;


Moderiert von user profile iconMotzi: Code- durch Delphi-Tags ersetzt.
Muetze1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 346



BeitragVerfasst: Do 24.06.04 09:38 
Moin!

Den Teil über deinem Kommentar musst du auch innerhalb deiner Form Klasse schreiben im private/public oder protected Abschnitt. Hast du das auch gemacht? Weil sonst erlaubt er auch kein MessageHandler für eine Nachricht, weil eine Funktion so hat keine Schnittstelle wo die Nachrichten "vorbeikommen".

MfG
Muetze1
Biarchiv Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 688



BeitragVerfasst: Fr 25.06.04 09:57 
Hello,

ich habe das:
procedure WMSysCommand(var Message: TWMSysCommand); message WM_SysCommand;

auch bei private und public probiert. Doch beim erstenmal runterlegen erscheint das Programm wieder in der Taskleiste.
Muetze1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 346



BeitragVerfasst: Fr 25.06.04 10:08 
Moin!

Füge zu dem Hide noch ein ShowWindow(Handle, SW_HIDE); hinzu und es sollte klappen. Ansonsten als Beispiel dazu schau mal hier nach.

MfG
Muetze1
Biarchiv Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 688



BeitragVerfasst: So 27.06.04 09:55 
Hallo,

danke ist gegangen.
Noch eine kleine Frage.

Kann man das Programm auch per Button
minimieren ohne das es in das Taskleister steht.

Habe es mal mit:
Application.Minimize;
probiert nur steht ist es in der Taskleiste.
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: So 27.06.04 10:11 
ausblenden Delphi-Quelltext
1:
ShowWindow(Application.Handle, SW_HIDE);					

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
MathiasSimmack
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 27.06.04 11:51 
Das Problem, auch bei deinem Beispiel, @Muetze, ist aber weiterhin der Hotkey WIN-Taste+M, bzw. WIN+D. Solange man die Anwendung über den Button in der Titelleiste minimiert, solange verschwindet auch der Knopf aus der Taskleiste.

Bei den o.g. Icons allerdings nicht. Das Problem dürfte daran liegen, dass der "wParam" SIZE_MINIMIZED ignoriert wird. Jedenfalls bei Delphi 5 und 7. Bei einer nonVCL-Anwendung gibt es dieses Problem nämlich nicht.

Und es ist eine schöne Gelegenheit, Motzi wieder mal daran zu erinnern, dass er eigentlich nachschauen wollte, wie er das gemacht hat ... denn er schrieb einmal, in seinem Programm würde das wohl gehen. Angeblich. Bewiesen hat er´s bisher noch nicht. :mrgreen:
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: So 27.06.04 12:03 
MathiasSimmack hat folgendes geschrieben:
Und es ist eine schöne Gelegenheit, Motzi wieder mal daran zu erinnern, dass er eigentlich nachschauen wollte, wie er das gemacht hat ... denn er schrieb einmal, in seinem Programm würde das wohl gehen. Angeblich. Bewiesen hat er´s bisher noch nicht. :mrgreen:

Hoppla.. das muss aber wohl schon länger her sein.. weiß nicht mehr genau was du meinst.. :oops: aber wenn dus mir sagst kann ich gern mal nachschaun! ;)

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
MathiasSimmack
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 27.06.04 17:12 
Kann ich machen: WM_SIZE + SIZE_MINIMIZED geht nicht? Oh, ich sehe gerade, du hattest damals einen Link zu einer deiner Komponenten gepostet, in der das klappen soll ... :oops: ... Irgendwie bin ich nie dazu gekommen, das man auszuprobieren. Also mach ich´s jetzt eben mal ...
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: So 27.06.04 21:25 
Aja.. also ich hab mal die entsprechenden Zeile von meiner TTaskbar rauskopiert:
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:
    WM_SIZE :
    begin
      if (Message.wParam = SIZE_MINIMIZED) and IsWindowVisible(FForm.Handle) then
      begin
        ShowWindow(FForm.Handle, SW_HIDE);
        if FForm.FormStyle <> fsMDIChild then
          FForm.Hide;
      end;
      CallOriginalWndProc;
    end;

    WM_SYSCOMMAND :
    begin
      if (TWMSysCommand(Message).CmdType and $FFF0) = SC_MINIMIZE then
      begin
        bRestoreWindow := False;
        CallOriginalWndProc;
        bRestoreWindow := True;
      end
      else                
        CallOriginalWndProc;
    end;

Ich hoffe ich hab das Problem auch richtig verstanden... :/

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!