You basically have two options
The first solution is the easiest to code
In reply to Re: Win32 GUI freeze by eco in thread Win32 GUI freeze by ckant8