Click here to Skip to main content
15,915,851 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: VISTA Pin
Hans Dietrich27-Jun-07 21:26
mentorHans Dietrich27-Jun-07 21:26 
QuestionOnCtlColor Pin
sudheee27-Jun-07 20:50
sudheee27-Jun-07 20:50 
AnswerRe: OnCtlColor Pin
KarstenK27-Jun-07 21:00
mveKarstenK27-Jun-07 21:00 
GeneralRe: OnCtlColor Pin
sudheee27-Jun-07 22:57
sudheee27-Jun-07 22:57 
GeneralRe: OnCtlColor Pin
KarstenK27-Jun-07 23:12
mveKarstenK27-Jun-07 23:12 
AnswerRe: OnCtlColor Pin
alias_rizwan28-Jun-07 0:26
alias_rizwan28-Jun-07 0:26 
QuestionThread Question Pin
Programm3r27-Jun-07 20:47
Programm3r27-Jun-07 20:47 
AnswerRe: Thread Question Pin
KarstenK27-Jun-07 20:57
mveKarstenK27-Jun-07 20:57 
GeneralRe: Thread Question Pin
Programm3r27-Jun-07 21:00
Programm3r27-Jun-07 21:00 
AnswerRe: Thread Question Pin
Cedric Moonen27-Jun-07 21:16
Cedric Moonen27-Jun-07 21:16 
QuestionRe: Thread Question Pin
Programm3r27-Jun-07 22:02
Programm3r27-Jun-07 22:02 
AnswerRe: Thread Question Pin
Roger Stoltz27-Jun-07 21:55
Roger Stoltz27-Jun-07 21:55 
GeneralRe: Thread Question Pin
Programm3r27-Jun-07 22:03
Programm3r27-Jun-07 22:03 
QuestionMulti threading in c++ Pin
role127-Jun-07 20:27
role127-Jun-07 20:27 
QuestionStreach or skew a bitmap to fit to resizing button size Pin
robshere27-Jun-07 20:06
robshere27-Jun-07 20:06 
AnswerRe: Streach or skew a bitmap to fit to resizing button size Pin
KarstenK27-Jun-07 20:53
mveKarstenK27-Jun-07 20:53 
QuestionRe: You need a ownerdrawn Button Pin
robshere29-Jun-07 2:00
robshere29-Jun-07 2:00 
AnswerRe: You need a ownerdrawn Button Pin
KarstenK29-Jun-07 2:18
mveKarstenK29-Jun-07 2:18 
QuestionHelp Needed !!! Pin
SelvaKr27-Jun-07 18:28
SelvaKr27-Jun-07 18:28 
AnswerRe: Help Needed !!! Pin
JudyL_MD28-Jun-07 2:38
JudyL_MD28-Jun-07 2:38 
GeneralRe: Help Needed !!! Pin
SelvaKr28-Jun-07 19:17
SelvaKr28-Jun-07 19:17 
GeneralRe: Help Needed !!! Pin
JudyL_MD29-Jun-07 2:27
JudyL_MD29-Jun-07 2:27 
QuestionHow to close a user created message box without effecting the background Pin
msr_codeproject27-Jun-07 18:26
msr_codeproject27-Jun-07 18:26 
Good morning... My query is......

After user selects PRINT menu one message box(usr created)will appear.
The message box consists of 2 command button controls.
one is OK and the other is CANCEL.
If the user presses OK it should take snapshot of the background and should create a BITMAP IMAGE without the message box. That means IMAGE shouldn't contain the message box. For this I am calling EndDialog() function. But now the problem message box is creating some empty space in the background and IMAGE is coming with that empty space. But it shouldn't come.
The code is as folows.

After selecting PRINT menu it will execute the following code.... i.e.,
**************************************************************************8
CSaiMessage m_objMsg;
m_objMsg.m_strMSG = "\n\n\nPress Print to Print the Screen or Cancel To Quit";
m_objMsg.DoModal();
****************************************************************************
Know the message box will appear. If the user selects PRINT button it will execute the following code.....
****************************************************************************
void CSaiMessage::OnClickCmdbtnPrint()
{
CSaiMessage::EndDialog(10);
snap();
}
****************************************************************************

void CSaiMessage::snap()
{
CWnd* pWnd = AfxGetApp()->m_pMainWnd;

if (windowtobmp("ShipStatus.bmp",pWnd)==FALSE)
{
MessageBox("ERROR");
}
}

BOOL CSaiMessage::windowtobmp(CString filename,CWnd* pwnd)
{
CWindowDC dc(pwnd);
CDC memdc;
memdc.CreateCompatibleDC(&dc);

CRect rect;
pwnd->GetWindowRect(rect);

CBitmap bmp;
bmp.CreateCompatibleBitmap(&dc,rect.Width(),rect.Height()-150);

CBitmap* poldbmp = memdc.SelectObject(&bmp);
memdc.BitBlt(0,0,rect.Width(),rect.Height(),&dc,0,0,SRCCOPY);

memdc.SelectObject(poldbmp);

HANDLE hdib = ConvertDDBToDIB(bmp);
writebmp(filename,hdib);
GlobalFree(hdib);

CString strPrintFilePath = FindPrintFilePath();
HINSTANCE hInstancePrint;//,hInstanceEditor;

hInstancePrint = ShellExecute(this->m_hWnd,"print","ShipStatus.bmp",NULL,NULL,SW_HIDE);

return TRUE;
}


Thanks in Advance
Sairam
AnswerRe: How to close a user created message box without effecting the background Pin
Joan M27-Jun-07 18:58
professionalJoan M27-Jun-07 18:58 
Questionunit testing Pin
deeps_cute27-Jun-07 17:55
deeps_cute27-Jun-07 17:55 

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.