Autor Beitrag
lemmi68
Hält's aus hier
Beiträge: 15

WinXP / SuSE 9.2 / Windows 7 Beta
Delphi 7 Enterp. / Kylix3 / VS 2008
BeitragVerfasst: So 28.10.07 21:52 
Hallo Leute,

ich habe mit Delphi2007 ein Programm erstellt, das unter XP einwandfrei läuft, aber unter Vista allerdings Probleme macht. Ich bekomme die Fehlermeldung:

"Eigenschaft Visible kann in OnShow oder OnHide nicht verändert werden."

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:
procedure TForm1.FormHide(Sender: TObject);
begin
  activa:=true;
end;

procedure TForm1.FormPaint(Sender: TObject);
begin
  if activa=false then
  begin
    ShowWindow(Application.Handle, SW_HIDE);
    SetWindowLong(Application.Handle, GWL_EXSTYLE,GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW);
    ShowWindow(Application.Handle, SW_SHOW);
    if isvista=true then
    begin
      form1.Visible:=false;
      activa:=true;
      label4.Caption:=inttostr(Win32MajorVersion);
    end
    else
    begin
      form1.hide;
      label4.Caption:=inttostr(Win32MajorVersion);
      activa:=true;
    end;
  end;
end;


Das Form1 soll direkt nach dem Start nicht mehr angezeigt werden. Ich habe dafür ein TrayIcon erstellt und das als Visible in der Taskleiste liegen. So das das Form dann nicht angezeigt wird und alles über das POPUP-Menü gemacht werden kann. Hat einer 'ne Idee wie man das unter Vista macht? Ach ja, Zeile 15, da habe ich auch schon Form1.hide gehabt. Wie kann man das lösen?

Gruß,

Holger