In this pseudo code I am trying to display a selected bitmap by clicking on a button...
I am pretty sure this cannot function that way. Would WM_PRINT or WM_PRINTCLIENT be of more use? They are mentioned as alternatives to WM_PAINT in the following quote from MSDN:Code:case WM_COMMAND: { switch(LOWORD(wParam)) { case IDC_BTN_ROLL: { case WM_PAINT: { if(condition...) hDC = BeginPaint(hwndDlg, &Ps); bmpFull = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_BITMAP1)); MemDCFull = CreateCompatibleDC(hDC); SelectObject(MemDCFull, bmpFull); BitBlt(hDC, 50, 50, 112, 112, MemDCFull, 0, 0, SRCCOPY); DeleteDC(MemDCFull); DeleteObject(bmpFull); EndPaint(hwndDlg, &Ps); return TRUE; } } }ANy tips or more realistic code examples are welcome..."The WM_PAINT message is generated by the system and should not be sent by an application. To force a window to draw into a specific device context, use the WM_PRINT or WM_PRINTCLIENT message. Note that this requires the target window to support the WM_PRINTCLIENT message. Most common controls support the WM_PRINTCLIENT message."




Reply With Quote