Autor Beitrag
Dwing
Hält's aus hier
Beiträge: 9



BeitragVerfasst: Sa 26.03.05 14:48 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Button1Click(Sender: TObject);
begin
  SendMessage(FindWindow('MozillaWindowClass', nil),WM_SYSCOMMAND,SC_CLOSE,0);
end;


Mit dem Code habe ich versucht Firefox zu beenden, leider reagiert er nicht darauf.
Beim Internet Explorer (Findwindow('IEFrame....) wars kein Problem.

Gibt es noch ne andere Lösung?

Moderiert von user profile iconTino: Code- durch Delphi-Tags ersetzt.
Lesco
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 42



BeitragVerfasst: Sa 26.03.05 15:07 
Suche im MSDN WM_CLOSE

(Nicht getestet)
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Sa 26.03.05 15:20 
getestet :wink:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TForm1.Button1Click(Sender: TObject);
var
  wnd: HWND;
  DWResult: DWORD;
begin
 wnd := FindWindow('MozillaWindowClass', nil);
 if wnd <> 0 then
   SendMessageTimeout(wnd, WM_CLOSE, 0, 0,
    SMTO_ABORTIFHUNG or SMTO_NORMAL, 5000, DWResult);
end;