开发者

How to know which control window got focus right now in Modal dialog using Win32 API?

开发者 https://www.devze.com 2023-01-10 13:42 出处:网络
I am trying to do something with the Modal dialog in Win7. To do that I need to know which control window has got focus right now by using Win32 API. If I could know which control is now got focus the

I am trying to do something with the Modal dialog in Win7. To do that I need to know which control window has got focus right now by using Win32 API. If I could know which control is now got focus then I can send message to this window to do some specific task.

Could any one suggest me how should I know which control has got focu开发者_如何学运维s right now using win 32?


If you want to know which window has keyboard focus and you're only interested in windows belonging to your own thread use GetFocus.

Finding out which window in the entire system has focus requires a few steps:

  • GetForegroundWindow
  • GetWindowThreadProcessId
  • GetGUIThreadInfo
0

精彩评论

暂无评论...
验证码 换一张
取 消