I would like to make the following Win32 API calls after creation of this
window.
hDC = GetDC(hwnd);
// ... setup the pointer to a PIXELFORMATDESCRIPTOR ppfd here
int ipixelFormat = ChoosePixelFormat(hDC, ppfd);
BOOL isSet = SetPixelFormat(hDC, ipixelFormat, NULL);
int jpixelFormat = GetPixelFormat(hDC);
int ierr = GetLastError();
What I get is that isSet is TRUE but jpixelFormat is zero, which means the
call to SetPixelFormat went OK, but GetPixelFormat failed. The value of ierr
is 2000, which corresponds to ERROR_INVALID_PIXEL_FORMAT "The pixel format
is invalid".
Anybody got any idea? (please send any replies also to k...@isc.tamu.edu)
From Spy++ for this hwnd I see the following: (according to documentation
for SetPixelFormat these should be OK)
Window Styles: 56000000
WS_CHILD
WS_VISIBLE
WS_CLIPSIBLINGS
WS_CLIPCHILDREN
WS_OVERLAPPED
Extended Styles: 00000000
WS_EX_LEFT
WS_EX_LTRREADING
WS_EX_RIGHTSCROLLBAR
Class Styles: 00000008
CS_DBLCLKS