c++ - Button control takes some time to disable in dialog box -
I'm trying to take some long action in the dialog box from my mainthread. During that time I wanted to disable some control. I used EnableWindow (FALSE) for each control to disable it. But all other control except button control (such as slider control, CMFCIDitbro control, combo box control) are fully disabled before processing. But buttons are taking more time to disable control, they are almost finished when the operation is finished. As soon as I call EnableWindow (FALSE), were not disabling button controls? Why is it taking time to disable it?
You need to completely perform background tasks in another thread, and UI / control can be used by another thread You should use PostMessage
, if the call does not work directly on EnableWindow
Setfocus
, for example, does not work with a different thread
Comments
Post a Comment