Gadgets lose focus when window does?

Windows specific forum
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Gadgets lose focus when window does?

Post by Karbon »

I've checked and re-checked to try and figure out why when I switch to another application and come back to mine the focus is gone from the last gadget that had it. Is this something that happens automatically or something I'm doing that I just haven't found yet?

Thanks!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Gadgets lose focus when window does?

Post by PB »

Seems to be a bug -- no other apps behave that way. Just check for
lost/gained focus of your app, using GetForegroundWindow_() and
your WindowID(), and then use ActivateGadget to restore the gadget
focus manually. A bit of a hassle, yes, but will fix your problem.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Yeah, but I'd have to track what gadget had the focus when window focus was lost.. Argh :-)

Thanks for verifying though!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> I'd have to track what gadget had the focus when window focus was lost

In your main loop, just stick handle=GetFocus_() and it'll always hold the
handle of the gadget with the focus. :)
Post Reply