本文整理自网络,侵删。
WinAPI: GetTopWindow - 获取指定窗口的子窗口中最顶层的窗口句柄//声明: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;
相关阅读 >>
Delphi 判断uefi与 legacy bios启动模式
Delphi 窗体的位置和高宽度-tform:letf、top、width、height、clientwidth、clientheight
更多相关阅读请进入《Delphi》频道 >>