//声明:
GetTopWindow(
  hWnd: HWND; {指定的窗口句柄}
): HWND;      {失败返回0; 成功返回最顶层的子窗口句柄}

这和用 GetWindow 函数使用 GW_CHILD 参数时应该是一样的, 测试一下:
var
  h1,h2: HWND;
begin
  h1 := GetTopWindow(GetDesktopWindow);
  h2 := GetWindow(GetDesktopWindow, GW_CHILD);
  ShowMessage(Format('%d,%d',[h1,h2])); {132540,132540}
end;

posted on 2008-02-28 14:30  万一  阅读(15603)  评论(7编辑  收藏  举报