I get a 9 digit value for bmpSample lol.
bitmapDC = GetDC((HWND)bitmapHandle);
bmpSample = GetPixel(bitmapDC, 23, 31);
cout << "aaa " << bmpSample << '\n';
this question belongs on the windows board...
// bitmapDC = GetDC((HWND)bitmapHandle);
first of all, why are you casting an HBITMAP to HWND? their completely incompatible types. you need to create a compatible device context with the one you'll be drawing to (in this case, the screen), then select the bitmap into it.
HDC sdc = GetDC(NULL); // ie: the screen
HDC cdc = CreateCompatibleDC(sdc);
Moved to the Windows board.
Maybe if you can put bitmapHandle in a static control..you can use correctly GetPixel