Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Barbara Peisch
  Where is Barbara Peisch?
 Oceanside
 California - United States
 Barbara Peisch
 To: Mike Gagnon
  Where is Mike Gagnon?
 Pointe Claire
 Canada
 Mike Gagnon
 Tags
Subject: RE: sys(1037) =programtically
Thread ID: 112422 Message ID: 112465 # Views: 2 # Ratings: 0
Version: Visual FoxPro 7 Category: Reports and Printers
Date: Wednesday, November 08, 2006 9:14:17 PM         
   


Sorry, but I don't see how this answers the question. First, Saifuddin asked for a technique that doesn't show a print dialog, and showing a print dialog is exactly what you're doing. And although this changes the structure of properties for the printer, I don't see any place where you're sending that to the printer. IOW, if you run the program again, it's showing the printer defaults, not the settings you selected.

> You can change the struct if you know which values to change, for exmaple PD_ALLPAGES 0 means that the selection in Sys(1037) will be set to print all pages, if you change the value to 2 it will change that selection to printing a page range ect....
>
>
#Define PD_ALLPAGES 0
> #Define PD_RETURNDC 256
> #Define PD_USEDEVMODECOPIESANDCOLLATE 262144 && 0x40000
> #Define PD_RETURNDEFAULT 1024 && 0x400
> Do setPrinterPrompt
> 
> 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

>
>
> > Hi
> >
> > I want to programatically control the options of the dialog box which noramlly appears with the sys(1037).
> >
> > I do not want to use the sys(1037), instead change its settings from within the .prg file
> >
> > Is it possible, how.
> >
> > regards
> > Saif

>
>
>
> Mike Gagnon
>




-BP
www.peisch.com

ENTIRE THREAD

sys(1037) =programtically Posted by Saifuddin Tehami @ 11/8/2006 12:16:57 PM
RE: sys(1037) =programtically Posted by Borislav Borissov @ 11/8/2006 12:26:33 PM
RE: sys(1037) =programtically Posted by Saifuddin Tehami @ 11/8/2006 12:57:16 PM
RE: sys(1037) =programtically Posted by Borislav Borissov @ 11/8/2006 1:10:47 PM
RE: sys(1037) =programtically Posted by Saifuddin Tehami @ 11/8/2006 1:17:45 PM
RE: sys(1037) =programtically Posted by Borislav Borissov @ 11/8/2006 1:33:17 PM
RE: sys(1037) =programtically Posted by Barbara Peisch @ 11/8/2006 8:20:50 PM
RE: sys(1037) =programtically Posted by Mike Gagnon @ 11/8/2006 8:55:58 PM
RE: sys(1037) =programtically Posted by Mike Gagnon @ 11/8/2006 2:26:08 PM
RE: sys(1037) =programtically Posted by Barbara Peisch @ 11/8/2006 9:14:17 PM
RE: sys(1037) =programtically Posted by Mike Gagnon @ 11/8/2006 9:37:38 PM