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