怎样取得当前程序的最上层窗口?大侠们救命啊!很急得!

kingeboy 2006-08-12 11:20:05
RT
我想实现得是,查找程序中最上层窗体,判断有没有被设置焦点,如果没有则激活窗体,只要是当前程序中的窗体不管有没有已激活的窗体,只要最上面的一个没被激活(比如设置TopMost属性的窗体)就激活它,我用GetWindow也总是得不到,不知道要怎么搞?
...全文
409 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
LuoGD 2006-09-09
  • 打赏
  • 举报
回复
GetLastWindow
xxelement 2006-09-06
  • 打赏
  • 举报
回复
我的理解是,一般情况下最上层Form都是Active的.
BlueDeepOcean 2006-09-06
  • 打赏
  • 举报
回复
GetTopWindow即可。
lwluser 2006-09-06
  • 打赏
  • 举报
回复
Application.ActiveWindowHandle还是
Application.ActiveFormHandle记不清了,2006才有
smilingchen 2006-08-29
  • 打赏
  • 举报
回复
mark
玄之丞 2006-08-14
  • 打赏
  • 举报
回复
GetTopWindow 试试。
类库 2006-08-13
  • 打赏
  • 举报
回复
GetActiveWindow()
cczlp 2006-08-13
  • 打赏
  • 举报
回复
The SetFocus function sets the keyboard focus to the specified window. The window must be associated with the calling thread's message queue.

HWND SetFocus(
HWND hWnd // handle to window to receive focus
);
柯本 2006-08-13
  • 打赏
  • 举报
回复
不是很明白你的意思,要得到程序中最上层窗体,可以用GetTopWindow
HWND GetTopWindow(

HWND hWnd // handle of parent window
);
kingeboy 2006-08-13
  • 打赏
  • 举报
回复
怎么没人懂啊?

1,222

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧