Strange tab behaviour when madExcept dialog showing

delphi package - automated exception handling

Strange tab behaviour when madExcept dialog showing

Postby zunzster » Thu Mar 05, 2020 2:33 am

We had a strange report about funny chevron characters turning up in our edit controls rather than tabbing to the next control but it only happened intermittently.

We eventually tracked it down to only happening when there is a madExcept exception dialog showing which hasn't been actioned yet i.e. continue, restart, close etc. not chosen.
I'd always assumed those madExcept dialogs were modal but they aren't which makes sense since they are running on a different thread and message loop.
If I click to move the keyboard focus back to one of our controls and press tab or shift tab, I get a chevron character (how we indicate tab in strings) rather than tabbing to the next or prior control.
If I close the madExcept dialog by selecting continue, pressing tab and shift tab now work again as normal.

We use our own edit controls rather than stock Delphi TEdits and I thought it might be something we are doing, so I built a simple project with a pair of TEdits and a button which generates an Access Violation.
When the madExcept dialog is showing and I press Tab, rather than moving between the edits, I get a windows beep. So again, the control is getting a TAB keypress it doesn't expect .

I wondered if the madExcept dialog was putting in place some kind of message filter and changing the handling of WM_GETDLGCODE messages but I can't see anything so I'm at a bit of a loss.

Any ideas where else to look in the madExcept dialog code to avoid this?
zunzster
 
Posts: 58
Joined: Wed Oct 29, 2008 3:43 am

Re: Strange tab behaviour when madExcept dialog showing

Postby madshi » Mon Mar 09, 2020 2:03 pm

Hmmmm... That chevron character and Windows beep thing sounds pretty weird. You don't have set "HandleMessagesInMainThread := false", have you?

Which Delphi version are we talking about?
madshi
Site Admin
 
Posts: 10249
Joined: Sun Mar 21, 2004 5:25 pm

Re: Strange tab behaviour when madExcept dialog showing

Postby zunzster » Mon Mar 09, 2020 10:58 pm

Sorry, for the slow reply. I wasn't notified of your reply which is probably my fault for not checking some button.

HandleMessagesInMainThread is True as that seems to be the default. It's Delphi 10.1 Berlin.
zunzster
 
Posts: 58
Joined: Wed Oct 29, 2008 3:43 am

Re: Strange tab behaviour when madExcept dialog showing

Postby madshi » Tue Mar 10, 2020 7:38 pm

Should be fixed in this build:

http://madshi.net/madCollectionUpdate.exe

Basically madExcept replaced the main thread message loop and didn't have special handling for key messages. So I've now copied the VCL key message special handling. Hopefully doing that doesn't break anything...
madshi
Site Admin
 
Posts: 10249
Joined: Sun Mar 21, 2004 5:25 pm

Re: Strange tab behaviour when madExcept dialog showing

Postby zunzster » Thu Mar 12, 2020 5:24 am

Awesome. Did you do the change in madExcept 4.x or 5.x?
I haven't switched to 5.0 yet - it's on my todo list, but I could if needs be.
zunzster
 
Posts: 58
Joined: Wed Oct 29, 2008 3:43 am

Re: Strange tab behaviour when madExcept dialog showing

Postby madshi » Thu Mar 12, 2020 9:16 am

madExcept 5, of course... :D
madshi
Site Admin
 
Posts: 10249
Joined: Sun Mar 21, 2004 5:25 pm

Re: Strange tab behaviour when madExcept dialog showing

Postby zunzster » Sat Mar 14, 2020 3:18 am

Upgraded to 5.0 and my issue is indeed fixed. I'll let you know if any regressions emerge but I'm pretty optimistic looking at the nature of the change.
Thanks a lot for your prompt attention to this, as always, Matthias.
zunzster
 
Posts: 58
Joined: Wed Oct 29, 2008 3:43 am

Re: Strange tab behaviour when madExcept dialog showing

Postby madshi » Sat Mar 14, 2020 8:29 am

Happy to hear that!
madshi
Site Admin
 
Posts: 10249
Joined: Sun Mar 21, 2004 5:25 pm


Return to madExcept

Who is online

Users browsing this forum: No registered users and 25 guests

cron