I have a CButton
derived class that's being written to at a very high rate from an independent thread (does it through a PostMessage
, the handler does SetWindowText
). Under some circumstances, the independent thread works faster than the UI updates, so its PostMessage
calls result in freezing the UI.
This isn't a huge problem in Windows, it only happens under certain circumstances and I already figured out a patch that makes it work all the time, but it causes major headaches in Linux (being run through WINE).
I was wondering if there's a way to essentially do what SetWindowText()
does without actually calling that call (member variable I can load)? Problem is the call works synchronously and is very ineffective when being called on a window that isn't even visible (slow even though there's no drawing occurring, and yes, I know it's a SendMssage
with WM_SETTEXT
). It's faster to check the window status yourself but if you do that you may miss updating the window when it's closed.
I guess I can replace the handler with just loading variables that are interpreted on a custom paint/draw routine. Just want to know if anyone else has suggestions for high-speed text updates to a CButton
object (in a multithreaded environment).