Paint Problem with Windows 10

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
In need of some credit
In need of some credit
Posts: 1
Joined: Sat Mar 28, 2020 6:28 pm

Paint Problem with Windows 10

Post by MaxGaspa » Sat Mar 28, 2020 8:24 pm

Dear All,

I'm a new user and I'm writing because I have got a strange issue using wxWidgets in Windows 10. My environment is

Compiler MinGW-64 (Msys 2) gcc is 8.3.0
OS Windows 7 and Windows 10 (latest updates)
wxWidgets 3.1.3

Hereafter a short description....

Basically my application is based on a class derived from wxFrame, when I close the application the close event is handled by the handler

void MainFrame::OnClose(wxCloseEvent& event)

In windows 7 I never observed any issue (the app is 5 year old!!) but when I started using Windows 10 I have got a crazy behavior. Normally the application is closed correctly. No issue. BUT if I minimize the frame two possible results are observed. If I restore the frame after few seconds and close it everything is OK. But if I wait a longer time the Destory() call creates a crash of the application.

Using the debugger it seems that everything is OK till the function Destroy() is called. In case of crash the DrMinGW post-mortem debugger is reporting a dump (attached). It seems that a paint event is sent to the application that is causing a crash.

In case of crash the debugger stops at


( QueueEvent(event.Clone()); )

I know that in Windows 10 "iconized windows don't get any messages", as I read in the bug tracker. So it seems that the paint event is "delayed" and once sent some related objects are already destroyed and a crash occurs. (just my guess).

Any help is really appreciated because I'm getting crazy to avoid the crash.


(4.82 KiB) Downloaded 14 times

User avatar
Posts: 14786
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Paint Problem with Windows 10

Post by doublemax » Sat Mar 28, 2020 9:04 pm

I know that in Windows 10 "iconized windows don't get any messages"
Did you test with the fixed version?

What happens if you don't call Destroy() and call event.Skip() instead? (Which should do the same, as this is the default behavior).
Use the source, Luke!

Post Reply