Click here to Skip to main content
15,919,245 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: The number of new and unread emails Pin
greatbear992-Sep-03 2:29
sussgreatbear992-Sep-03 2:29 
QuestionHow to find which Window have some DC ? Pin
vgrigor1-Sep-03 1:34
vgrigor1-Sep-03 1:34 
AnswerRe: How to find which Window have some DC ? Pin
Vitali Halershtein1-Sep-03 1:59
Vitali Halershtein1-Sep-03 1:59 
GeneralRe: How to find which Window have some DC ? Pin
vgrigor1-Sep-03 2:00
vgrigor1-Sep-03 2:00 
GeneralRe: How to find which Window have some DC ? Pin
Vitali Halershtein1-Sep-03 2:12
Vitali Halershtein1-Sep-03 2:12 
Generalclient server program Pin
vision20041-Sep-03 0:42
vision20041-Sep-03 0:42 
GeneralRe: client server program Pin
valikac1-Sep-03 5:52
valikac1-Sep-03 5:52 
GeneralDrawing on Dialog using DC Pin
YaronNir1-Sep-03 0:04
YaronNir1-Sep-03 0:04 
Hi all,

i have a dialog, i catch the OnPaint() message. here is the code

void CMyDialog::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	GetWindowRect(m_rectDlg);
        PlaceTitleBorder(dc);
}


in in the PlaceTitleBorder() method i draw a bitmap:

void CMyDialog::PlaceTitleBorder(CPaintDC &dc)
{
	BITMAP bmp;
	memset(&bmp,0,sizeof(bmp));
	::GetObject(m_hTitleBorder,sizeof(bmp),&bmp);	
	HDC compatibleDC = ::CreateCompatibleDC(dc);
	HBITMAP hSavedObj;
	hSavedObj = (HBITMAP)::SelectObject(compatibleDC,m_hTitleBorder);
	BOOL bRes = StretchBlt(dc, 
			   m_rectTitleBorder->left,
			   m_rectTitleBorder->top,
			   m_rectTitleBorder->Width(),
			   m_rectTitleBorder->Height(),
			   compatibleDC,
			   0,
			   0,
			   bmp.bmWidth,
			   bmp.bmHeight,
			   SRCCOPY);
	::SelectObject(compatibleDC,hSavedObj);
	::DeleteDC(compatibleDC);	
}


when dialog appear i see the bitmap ok. when i move the dialog around the screen and go out of the bounds of the screen, and then return to the screen, the bitmap disappears (not redrawn???) can any1 help me??

thanks in advanced

Yaron

Ask not what your application can do for you,
Ask what you can do for your application
GeneralRe: Drawing on Dialog using DC Pin
Vitali Halershtein1-Sep-03 0:19
Vitali Halershtein1-Sep-03 0:19 
GeneralRe: Drawing on Dialog using DC Pin
YaronNir1-Sep-03 1:00
YaronNir1-Sep-03 1:00 
GeneralRe: Drawing on Dialog using DC Pin
Vitali Halershtein1-Sep-03 2:23
Vitali Halershtein1-Sep-03 2:23 
GeneralRe: Drawing on Dialog using DC Pin
csc1-Sep-03 2:10
csc1-Sep-03 2:10 
GeneralRe: Drawing on Dialog using DC Pin
YaronNir1-Sep-03 2:12
YaronNir1-Sep-03 2:12 
GeneralString Parsing Pin
KKR31-Aug-03 23:50
KKR31-Aug-03 23:50 
GeneralRe: String Parsing Pin
Vitali Halershtein1-Sep-03 0:08
Vitali Halershtein1-Sep-03 0:08 
GeneralRe: String Parsing Pin
KKR1-Sep-03 0:20
KKR1-Sep-03 0:20 
GeneralRe: String Parsing Pin
Vitali Halershtein1-Sep-03 0:31
Vitali Halershtein1-Sep-03 0:31 
GeneralRe: String Parsing Pin
KKR1-Sep-03 0:56
KKR1-Sep-03 0:56 
GeneralDetermine whether keyboard connected with computer Pin
El'Cachubrey31-Aug-03 23:05
El'Cachubrey31-Aug-03 23:05 
GeneralLengthy operation without blocking the UI Pin
Jeremy Pullicino31-Aug-03 22:21
Jeremy Pullicino31-Aug-03 22:21 
GeneralRe: Lengthy operation without blocking the UI Pin
RChin31-Aug-03 22:57
RChin31-Aug-03 22:57 
GeneralRe: Lengthy operation without blocking the UI Pin
Frank Downunder1-Sep-03 2:17
Frank Downunder1-Sep-03 2:17 
GeneralFraction number input and output Pin
Jahangir Jamshed31-Aug-03 21:52
sussJahangir Jamshed31-Aug-03 21:52 
GeneralRe: Fraction number input and output Pin
KaЯl1-Sep-03 5:23
KaЯl1-Sep-03 5:23 
GeneralRe: Fraction number input and output Pin
LittleYellowBird1-Sep-03 5:36
LittleYellowBird1-Sep-03 5:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.