Well, the AllocateHwnd() function is just 12 lines of plain Windows API code. Why do you think it is a bug in the RTL? I would volunteer to open an issue at Embaracdro's issue tracker, but I need more details to do so.madshi wrote: 2) The test program from jmarder is interesting. Basically it shows that crashes inside of a custom "AllocateHwnd()" window proc aren't always caught by madExcept. I've analyzed this problem in detail and it seems that the exception is bypassing all of Delphi's own RTL exception handling somehow, so madExcept never gets access to it, and even Windows's "SetUnhandledExceptionFilter()" API doesn't work. It looks like a bug in the RTL to me
Unfortunately it is not that easy. AllocateHwnd() is used in several places in the VCL where I can't add this. AllocateHwnd() is also used in many 3rd party libraries where this exception hadnling is also missing and where you can't easily reference MadExcept as not every Delphi Developer has it installed.madshi wrote: Fortunately, the problem seems to be limited to AllocateHwnd(), and it's easy enough to manually solve by adding a "try .. except madExcept.HandleException() end" block around the AllocateHwnd() window proc.