PDA

Click to See Complete Forum and Search --> : API Print Dialog (help?)


lcdial
Nov 22nd, 2000, 09:18 AM
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:

'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!

Vlatko
Nov 22nd, 2000, 10:20 AM
If a <> 0 then
'the user didn't press cancel
End If

lcdial
Nov 22nd, 2000, 10:44 AM
oh....how....easy. DUH! Thanks a bunch!

Boy, is my face red!