delphi中怎么获得一个窗口的弹出子窗口的句柄

2025-02-23 15:04:31
推荐回答(1个)
回答1:

dim hwnd as int32=GetParent(hchild)
hwnd 就是hchild的父窗口句柄
如果要获得最顶级父窗口,可以利用循环
dim hwnd as int32
do
hwnd=GetParent(hchild)
if hwnd=0 then
exit do
endif
hchild=hwnd
loop
循环结束后,hchild就是顶级父窗口的句柄。