Pros/Cons of using WM_PAINT for rendering
You might try running a PeekMessage loop, then sleeping for a bit (about 20 to 100 ms should be enough), after your CreateWindow - just to give everything a chance to settle down before you proceed with getting the DC. CreateWindow(Ex) sends a WM_CREATE message to your Window procedure before returning, but - like I indicated above - there is no guarantee that the message has actually arrived yet.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement