Aric Stewart : imm: Default context and hwnd are per thread so store that data in a thread local storage .