#### Archived

This topic is now archived and is closed to further replies.

# Painting in Dialog Window?

This topic is 5779 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, How do I BitBlt a bitmap into the client area of a Dialog Window? To BitBlt something into the main window I use this piece of code:
  HDC hdc, memdc; hdc = BeginPaint(hwnd, &paintstruct); // memdc = CreateCompatibleDC(hdc); SelectObject(memdc, hbit); vRenderWhatever(hdc, memdc); // To display DC from bitmap DC DeleteDC(memdc); EndPaint(hwnd, &paintstruct); 
Let''s say that I want to blit to a dialog window instead in a similar way, how would I do that? Any special procedures or I just get a handle to the Dialog window, and do my rendering from there? What about the client area? I am a bit confused here, so all help is much appreaciated. What I am doing is a tilebased game, and I have a dialog box for selecting what level to play, and I want to preview a small level map there, hence blitting a small level map to the dialog window. Do I need to set up a particular area of the dialog window for holding the bitmap, or I am free to Blt wherever I want? Thanks for the help!!! No MFC as you can see...

##### Share on other sites
A dialog doesn''t have a client in the same sense as a regular window. Put a static control in the dialog and target that.

##### Share on other sites
Thanks a lot for pointing me in the right direction, I had some problems getting it to work but everything is fine now! Thank you!