FindWindowEx

 

procedure CloseGameSver();
var
  H1, h2: HWND;
begin
  H1 := FindWindow('TForm1', nil);
  h2 := FindWindowEx(H1, 0, 'ConsoleWindowClass', nil);
  // ShowMessage(Inttostr(h2));
  SendMessage(h2, WM_CLOSE, 0, 0);
end;

 

posted @ 2014-01-21 20:28  XE2011  阅读(232)  评论(0编辑  收藏  举报