Click here to Skip to main content
16,011,988 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Position of child windows. Pin
Tim Deveaux10-Dec-00 4:53
Tim Deveaux10-Dec-00 4:53 
GeneralRe: Position of child windows. Pin
10-Dec-00 4:58
suss10-Dec-00 4:58 
GeneralCannot access HELP (SEARCH) in Visual C++ 6.0 Pin
9-Dec-00 17:10
suss9-Dec-00 17:10 
GeneralRe: Cannot access HELP (SEARCH) in Visual C++ 6.0 Pin
Anders Molin10-Dec-00 0:42
professionalAnders Molin10-Dec-00 0:42 
QuestionHow to save a CView screenshot as BITMAP? Pin
9-Dec-00 15:00
suss9-Dec-00 15:00 
AnswerRe: How to save a CView screenshot as BITMAP? Pin
Christian Graus9-Dec-00 21:15
protectorChristian Graus9-Dec-00 21:15 
Generalchanging the print dialog box Pin
9-Dec-00 4:23
suss9-Dec-00 4:23 
GeneralRe: changing the print dialog box Pin
Tim Deveaux9-Dec-00 15:45
Tim Deveaux9-Dec-00 15:45 
Doing this will be difficult, since you'd have to either disable print setup or chase all the proprietary printer setup dialogs.

Here's an option that traps the wonky paper size before printing starts, and localizes things in OnPreparePrinting:

/////////////////////////////////////////////////////////////////////////////
// CSDITestView printing
 
BOOL CSDITestView::OnPreparePrinting(CPrintInfo* pInfo)
{
 
    BOOL retval;
 
    while(1) {
        // instead of returning this result directly, lets see if we can warn the user
       retval = DoPreparePrinting(pInfo);
 
        // pInfo now has the info we need...
        if(retval) { // user didn't cancel out of the setup
            DEVMODE *dm = pInfo->m_pPD->GetDevMode();
            if(dm->dmPaperSize != DMPAPER_LETTER && dm->dmPaperSize != DMPAPER_LEGAL) {
                if(IDCANCEL == MessageBox("Paper size is yada yada...", "Prepare printing...", MB_OKCANCEL)) {
                    retval = FALSE;
                    break;
                }
                else {
                    continue;
                }
            }
            else {
                break;
            }
        }
        else {
            break;
        }
    }
    return retval;
}


You don't necessarily have to send the user back to the print setup, as this does. Not very friendly, really.

Check the docs for DEVMODE for lots of other good things you can check.

BTW this is not to say you can't alter the print dialog - if what you want to do is add something, rather than disable something, check out Al Stevens article in the December Dr. Dobbs for one approach.
QuestionWhat can i do if I want to draw my own frame on a tool bar? Pin
Mr.Nodman9-Dec-00 1:11
Mr.Nodman9-Dec-00 1:11 
Questionreturn file name from GetOpenFileName? Pin
8-Dec-00 22:44
suss8-Dec-00 22:44 
AnswerRe: return file name from GetOpenFileName? Pin
Michael Dunn9-Dec-00 6:50
sitebuilderMichael Dunn9-Dec-00 6:50 
GeneralDialog Pin
8-Dec-00 22:33
suss8-Dec-00 22:33 
GeneralRe: Dialog Pin
Christian Graus9-Dec-00 9:46
protectorChristian Graus9-Dec-00 9:46 
GeneralRe: Dialog Pin
Matt Philmon9-Dec-00 9:54
Matt Philmon9-Dec-00 9:54 
QuestionMFC without a dialog or view? Pin
8-Dec-00 14:08
suss8-Dec-00 14:08 
AnswerRe: MFC without a dialog or view? Pin
Erik Funkenbusch8-Dec-00 18:03
Erik Funkenbusch8-Dec-00 18:03 
GeneralRe: MFC without a dialog or view? Pin
8-Dec-00 19:23
suss8-Dec-00 19:23 
GeneralRe: MFC without a dialog or view? Pin
Erik Funkenbusch8-Dec-00 21:58
Erik Funkenbusch8-Dec-00 21:58 
GeneralRe: MFC without a dialog or view? Pin
10-Dec-00 21:46
suss10-Dec-00 21:46 
GeneralRe: MFC without a dialog or view? Pin
Erik Funkenbusch11-Dec-00 12:17
Erik Funkenbusch11-Dec-00 12:17 
GeneralMinimized Window doesnot show up Pin
8-Dec-00 9:38
suss8-Dec-00 9:38 
GeneralHelp with string class - return char * Pin
Christian Graus7-Dec-00 12:04
protectorChristian Graus7-Dec-00 12:04 
GeneralRe: Help with string class - return char * Pin
Michael Dunn7-Dec-00 13:35
sitebuilderMichael Dunn7-Dec-00 13:35 
GeneralRe: Help with string class - return char * Pin
Christian Graus7-Dec-00 14:04
protectorChristian Graus7-Dec-00 14:04 
GeneralRe: Help with string class - return char * Pin
Erik Funkenbusch8-Dec-00 10:20
Erik Funkenbusch8-Dec-00 10:20 

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.