Einzelnen Beitrag anzeigen

dazar_t

Registriert seit: 1. Dez 2007
Ort: NRW
118 Beiträge
 
Delphi 2007 Professional
 
#1

Form verschwindet nicht von Taskleiste trotz code !

  Alt 24. Mär 2008, 16:30
Guten Tag..

Ich Programmiere grade ein Programm ( in Delphi 2007 ) das wärend der Laufzeit immer wieder sein Größe und seinne Sichtbarkeit ändert.

Um eine Form nun von der Taskleiste zu nehmen nehme ich gewöhnlich diesen Code :
Delphi-Quellcode:
  ShowWindow( Application.Handle, SW_HIDE );
  SetWindowLong( Application.Handle, GWL_EXSTYLE,
                 GetWindowLong(Application.Handle, GWL_EXSTYLE) or
                 WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);
  ShowWindow( Application.Handle, SW_SHOW );
Doch wirkt dieser bei meinem Programm nicht mehr !

Hier mal mein QuellCode :
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin
Timer1.Enabled := True;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Form1.Height := Screen.Height;
Form1.Width := 215;
ShowWindow( Application.Handle, SW_HIDE );
SetWindowLong( Application.Handle, GWL_EXSTYLE,
                 GetWindowLong(Application.Handle, GWL_EXSTYLE) or
                 WS_EX_TOOLWINDOW and not WS_EX_APPWINDOW);
ShowWindow( Application.Handle, SW_SHOW );
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
while Not(Form1.Width = 1) do
Form1.Width := Form1.Width - 1;
Form1.Visible := False;
Timer1.Enabled := False;
end;

procedure TForm1.Timer2Timer(Sender: TObject);
begin
Form1.Visible := True;
while Not(form1.Width = 215) do
Form1.Width := Form1.Width + 1;
Timer2.Enabled := False;
end;

procedure TForm1.Timer3Timer(Sender: TObject);
begin
if Mouse.CursorPos.x = Screen.Width - 1 then
Timer2.Enabled := True;
Timer4.Enabled := True;
end;

procedure TForm1.Timer4Timer(Sender: TObject);
begin
if (Form1.Width = 215) and (Mouse.CursorPos.X < Screen.Width - Form1.Width) then
Timer1.Enabled := True;
Timer4.Enabled := False;
end;

procedure TForm1.WMWindowPosChanging(var Message: TWMWINDOWPOSCHANGING);
begin
  Message.WindowPos.y := 0;
  Message.WindowPos.x := Screen.WorkAreaWidth - Width;
end;

end.

EDIT: // Habe grade mal nen TestProjeckt erstellt und gemerkt das der Code garnicht mehr wirkt das Programm bleibt immer in der Taskbar.
Als ich es aber in D7 probierte funktionierte es !???
Daniel
  Mit Zitat antworten Zitat