How to determine which gadget currently has the focus?

Just starting out? Need help? Post your questions and find answers here.
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

How to determine which gadget currently has the focus?

Post by merendo »

How do I determine, which of the existing gadgets currently has the focus?

Thanks for any help! merendo
spangly
User
User
Posts: 54
Joined: Mon Apr 28, 2003 8:26 pm
Contact:

Post by spangly »

try the following code (uses API calls)

Code: Select all

  id.l=GetWindowLong_(GetFocus_(),#GWL_ID)
id will be set to the ID of the window or gadget that has the focus, which seems work ok in my tests.
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Post by merendo »

Yes, it seems to work. Thank you very much!
Post Reply