Do setPrinterPrompt
#Define PD_ALLPAGES 0
#Define PD_RETURNDC 256
#Define PD_USEDEVMODECOPIESANDCOLLATE 262144 && 0x40000
#Define PD_RETURNDEFAULT 1024 && 0x400
Local lcStruct, hDc, lnFlags
lnFlags = PD_USEDEVMODECOPIESANDCOLLATE + PD_RETURNDC
lcStruct = num2dword(66) +;
num2dword(0) +;
num2dword(0) +;
num2dword(0) +;
num2dword(0) +;
num2dword(lnFlags) +;
num2word(65535) +;
num2word(65535) +;
num2word(1) +;
num2word(65535) +;
num2word(1) +;
num2dword(0) +;
num2dword(0) +;
num2dword(0) +;
num2dword(0) +;
num2dword(0) +;
num2dword(0) +;
num2dword(0) +;
num2dword(0) +;
num2dword(0)
If PrintDlg (@lcStruct) <> 0
hDc = buf2dword (Substr (lcStruct, 17, 4))
= DeleteDC (hDc)
Messagebox("The user chose the print button")
Else
Messagebox("The user chose the cancel button.")
Endif
Function num2dword (lnValue)
#Define m0 256
#Define m1 65536
#Define m2 16777216
Local b0, b1, b2, b3
b3 = Int(lnValue/m2)
b2 = Int((lnValue - b3 * m2)/m1)
b1 = Int((lnValue - b3*m2 - b2*m1)/m0)
b0 = Mod(lnValue, m0)
Return Chr(b0)+Chr(b1)+Chr(b2)+Chr(b3)
Function num2word (lnValue)
Return Chr(Mod(m.lnValue,256)) + Chr(Int(m.lnValue/256))
Function buf2dword (lcBuffer)
Return Asc(Substr(lcBuffer, 1,1)) + ;
Asc(Substr(lcBuffer, 2,1)) * 256 +;
Asc(Substr(lcBuffer, 3,1)) * 65536 +;
Asc(Substr(lcBuffer, 4,1)) * 16777216
Procedure SetPrinterPrompt
Declare Integer DeleteDC In gdi32 Integer hdc
Declare Integer PrintDlg In comdlg32;
STRING @ lppd