Adding missing thread messages WM_USER_SET_CHIP and WM_USER_VERIFY_EXPORT.
Fixing WaitForSingleObject. Fixing memory leak in CDC destructor. Fixing improper drawing in non-main thread.