Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

simbiant

gettin window information. help.

This topic is 5205 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

is there any windows API command that returns the hWnd of whatever the user has focus to? and i mean universally, across all the windows on the screen. meaning, if i have my cursor in a textbox on some random window, it would return the textbox hwnd. or if a button on another window had focus set to it, it would tell you that hwnd. is there such an api command?

Share this post


Link to post
Share on other sites
Advertisement
by the way i know of the function GetActiveWindow, but that only returns the parent window which has focus... i want the actual control within the window..

is it possible?

Share this post


Link to post
Share on other sites
GetFocus() only works for the current thread but the MSDN explains that you could use AttachThreadInput() on the forground thread to allow GetFocus() to work across threads.

Or, if you are using Win98 or Win NT SP3 or later, you could use GetGUIThreadInfo() with the first parameter as 0. The GUITHREADINFO structure has the HWNDs for windows in various GUI states.


Thanks Salsa!Colin Jeanne | Invader''s Realm
"I forgot I had the Scroll Lock key until a few weeks ago when some asshole program used it. It even used it right" - Conner McCloud

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!