kaloyan
asked on
How to close applications?
How to close running application with my programm?
I am using Delphi 3.
I am using Delphi 3.
If you want the program to ask the user whether the modified file shall be saved, use meikl's solution, otherwise send a WM_QUIT instead of a WM_CLOSE.
Regards, Madshi.
Regards, Madshi.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if you know the WindowTitle of the App you want to close, you can do it with this code
procedure TForm1.Button1Click(Sender
var
TheHandle : THandle;
begin
TheHandle := Findwindow(NIL, 'Microsoft Excel'); {Excel, no open documents}
If TheHandle > 0 then SendMessage(TheHandle,WM_C
end;
meikl