以下是关闭所有 do
S窗口
var
hCurrentWindow: HWnd;
szText: array[0..254] of char;
begin
hCurrentWindow :=
GetWindow(Handle, GW_HWNDFIRST);
while hCurrentWindow <> 0 do
begin
if GetWindowText(
hCurrentWindow, @szText, 255)>0 then
begin
Memo1.Lines.Add(StrPas(@szText));
if copy(szText,0,6)='MS-DOS' then
postmessage(hCurrentWindow,WM_quit,0,0);
end;
hCurrentWindow:= GetWindow(hCurrentWindow, GW_HWNDNEXT);
end;
end;