请教,SelectObject用法,显示为黑色
HDC hdc;
PAINTSTRUCT ps;
HDC hScrDC,hMemDC;
HBITMAP hBitmap,hOldBitmap;
hdc=BeginPaint(hwnd,&ps);
hScrDC=CreateDC("DISPLAY",NULL,NULL,NULL);
hMemDC=CreateCompatibleDC(hScrDC);
hBitmap=CreateCompatibleBitmap(hScrDC,nWidth,nHeight);
hOldBitmap=(HBITMAP)SelectObject(hMemDC,hBitmap);
BitBlt(hdc,0,0,nWidth,nHeight,hMemDC,0,0,SRCCOPY);
hBitmap=(HBITMAP)SelectObject(hMemDC,hOldBitmap);
显示为黑色,为什么不是显示桌面,谢谢!