Convenient and elegant way to update GUI elements from worker threads using PostEvent()! Seems to work fine, I like it, thanks for sharing

Up to now i was using different approach (2 ways communications with threads using global variables and mutexes ... ) but i think i will shift to your way, it is much simpler ... still i need to find a reliable way to stop a thread in the middle from main thread unless we run an event loop inside the threaded procedure

One question though, what is the use of DoWait() ??

Your module needs a custom-event value (in your example you are using #PB_Event_FirstCustomValue) ... i wish we had something like #PB_Event_LastCustomValue, because most projects would be already using #PB_Event_FirstCustomValue in one or other modules