procedure TForm1.AppDeactivate(Sender: TObject); var hw: HWnd; CurTask: THandle; WndStyle:Longint; begin CurTask:=GetWindowTask(handle); hw:=GetWindow(GetDesktopWindow, GW_CHILD); while GetWindowTask(hw)<>CurTask do hw:=GetWindow(hw, GW_HWNDNEXT);while (hw<>handle) and (GetWindowTask(hw)=CurTask) do begin PostMessage(hw, WM_Close, 0, 0); hw:=GetWindow(hw, GW_HWNDNEXT); end; end; |
[001736]