Results 1 to 3 of 3

Thread: API Print Dialog (help?)

  1. #1

    Thread Starter
    Member
    Join Date
    May 2000
    Location
    Boston, MA
    Posts
    52

    Question

    I'm using the API Print dialog and it works great, except for one thing: I don't know how to tell if the user has pressed Cancel or not. Here's some code:
    Code:
    'API Printer Dialog
        Dim tPrintDlg As PrintDlg
            tPrintDlg.lStructSize = Len(tPrintDlg)
            tPrintDlg.hwndOwner = Me.hWnd
            tPrintDlg.hdc = hdc
            tPrintDlg.flags = 0
            tPrintDlg.nFromPage = 0
            tPrintDlg.nToPage = 0
            tPrintDlg.nMinPage = 0
            tPrintDlg.nMaxPage = 0
            tPrintDlg.nCopies = 1
            tPrintDlg.hInstance = App.hInstance
            lpPrintTemplateName = "Print Page"
        
        Dim a
        a = PrintDlg(tPrintDlg)
    
        'Printing Code
    The Declarations are all correct and the dialog pops up, but when the user presses cancel, it does not set an error like the OCX and I can't find which flags it changes! HELP ME....please?

    Thanks!

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Code:
    If a <> 0 then
    'the user didn't press cancel
    End If
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3

    Thread Starter
    Member
    Join Date
    May 2000
    Location
    Boston, MA
    Posts
    52

    Talking oh.....yeah

    oh....how....easy. DUH! Thanks a bunch!

    Boy, is my face red!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width