Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / BlueGUI - getParentGadget finds IE and crashes

Author
Message
Juso
21
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 9th Aug 2007 16:30
If you use 'gadgetUnderMouse' and use that handle to get
'getParentGadget' and you move mouse over MS-Internet Explorer, you prog crashes immediatelly.



What to do? If IE is running in window next to your DBPro app, the mouse can accidentally move over IE
Alquerian
18
Years of Service
User Offline
Joined: 29th Mar 2006
Location: Reno Nevada
Posted: 10th Aug 2007 02:35
Well a possible current work around would be to build a list of all the gadget's HWNDS and put them in an array, then only call 'getParentGadget' if 'gadgetUnderMouse' is found within that array. That should solve that problem

Visit the Wip!
Juso
21
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 10th Aug 2007 10:01
Yes it should but number of gadgets is over 50, so its too much more code
Xolatron
18
Years of Service
User Offline
Joined: 12th Mar 2006
Location: The Star Forge Language: DBpro
Posted: 10th Aug 2007 18:22
The opposite of Alquerian's solution - check if it's *not* the browser (rather than check if it *is* a different gadget):
why just check if the gadgetUnderMouse() returns the BlueGUI browser's handle before finding the parent?



-Xol

Alquerian
18
Years of Service
User Offline
Joined: 29th Mar 2006
Location: Reno Nevada
Posted: 10th Aug 2007 21:10
Xol - I don't think he was checking for a blue gui web gadget, I think he was running IE in a separate window that was next to his dbp window, and he accidentally moved his mouse over the IE window.

Visit the Wip!
Xolatron
18
Years of Service
User Offline
Joined: 12th Mar 2006
Location: The Star Forge Language: DBpro
Posted: 11th Aug 2007 00:41
You're right - oops.

On that note, here's a routine not invovling an array. It's based on mousePosX() and a check whether the main window is active.



Note that mainWindow() has a minor bug in it, and this code will still crash if the user starts the app, then immediately switches to IE and let's it load in the background. I haven't found a way around this, but if I do I'll post again.

-Xol

Juso
21
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 11th Aug 2007 12:22
Thanks Xol, thats nice code.

But it is still a bug in BlueGUI, it may not crash with 'getParentGadget' if you move mouse over IE
Xolatron
18
Years of Service
User Offline
Joined: 12th Mar 2006
Location: The Star Forge Language: DBpro
Posted: 11th Aug 2007 18:44
You're welcome.

And yes, it's a bug - BlueGUI seems to be reporting the Windows' handle of gadgets under the mouse if they aren't a BlueGUI gadget, when a 0 or -1 would be more appropriate. And getGadgetParent should return a 0 or -1 as well if the gadget's parent is not a BlueGUI gadget (just a Windows one)

You could report it at the BlueGUI bug reports page: http://www.robertknight.me.uk/blue2/site/index.php?view=updates, then login and click "Bug Reports Page"

-Xol

Login to post a reply

Server time is: 2024-05-23 03:39:45
Your offset time is: 2024-05-23 03:39:45