procedure WaitForWindowDestroy(lpClassName, lpWindowName: PChar);
var
  H: HWND;
  Value: DWORD;
begin
  H := FindWindow(lpClassName, lpWindowName);
  if H = 0 then raise Exception.Create('FindWindow failed');

  GetWindowThreadProcessId(H, @Value);
  H := OpenProcess(PROCESS_ALL_ACCESS, False, Value);
  if H = 0 then raise Exception.Create('OpenProcess failed');

  try
    GetExitCodeProcess(H, Value);
    while Value = STILL_ACTIVE do
      GetExitCodeProcess(H, Value);
  finally
    CloseHandle(H);
  end;
end;

'Windows > RAD Studio' 카테고리의 다른 글

[SOCK] 소켓 에러 목록  (0) 2008.04.16
[RAD] TListBox - Horizontal Scroll Bar  (0) 2008.04.08
[RAD] TCanvas 의 글자 폭, 높이 구하기  (0) 2008.03.17
[CB] Excel binary 저장  (0) 2008.03.13
TComponentState type  (0) 2008.03.05

+ Recent posts