1. Accessing the default printer
- Posted by Andy Drummond <andy at kestrelt?l?.com> Oct 23, 2007
- 583 views
I had hoped that Win32Lib 0.70.1 would have a means of selecting the default printer as if the user had used getPrinter() to do so. Can anyone tell me how to do this? I once found how to find the name of the default printer (I think) but that didn't help me. I'd like to be able to hit a print button and print to the default printer with page attitude etc all set by the program. It seems like it is not so easy to do... AndyD
2. Re: Accessing the default printer
- Posted by don cole <doncole at pa?bell.?et> Oct 23, 2007
- 557 views
- Last edited Oct 24, 2007
Andy Drummond wrote: > > > I had hoped that Win32Lib 0.70.1 would have a means of selecting the default > printer as if the user had used getPrinter() to do so. Can anyone tell me how > to do this? I once found how to find the name of the default printer (I > think) > but that didn't help me. I'd like to be able to hit a print button and print > to the default printer with page attitude etc all set by the program. It seems > like it is not so easy to do... > > AndyD Does not getPrinter() give you the default printer? How many printers do you have? Don Cole
3. Re: Accessing the default printer
- Posted by don cole <doncole at p?cbell.n?t> Oct 23, 2007
- 575 views
- Last edited Oct 24, 2007
hello again Andy, Also see getPrintChoice() Don Cole
4. Re: Accessing the default printer
- Posted by "Greg Haberek" <ghaberek at gmail.com> Oct 23, 2007
- 558 views
- Last edited Oct 24, 2007
Try this: http://www.freewebtown.com/ghaberek/getDefaultPrinter.ew I wrote this a back in March and was planning to submit it to Win32Lib. It should probably be included, as it is quite useful. :) -Greg On 10/23/07, don cole <guest at rapideuphoria.com> wrote: > > > posted by: don cole <doncole at p?cbell.n?t> > > > hello again Andy, > > Also see getPrintChoice() > > Don Cole > > > >
5. Re: Accessing the default printer
- Posted by Andy Drummond <andy at kestrel?ele.com> Oct 24, 2007
- 566 views
Greg Haberek wrote: > > Try this: > > <a > href="http://www.freewebtown.com/ghaberek/getDefaultPrinter.ew">http://www.freewebtown.com/ghaberek/getDefaultPrinter.ew</a> > > I wrote this a back in March and was planning to submit it to > Win32Lib. It should probably be included, as it is quite useful. :) > > -Greg > > On 10/23/07, don cole <guest at rapideuphoria.com> wrote: > > > > > > posted by: don cole <doncole at p?cbell.n?t> > > > > > > hello again Andy, > > > > Also see getPrintChoice() > > > > Don Cole > > > > Great! thank you, Greg & Don. This is precisely what I wanted. So - CChris, how about adding this to the printing section of the Win32Lib next issue? I will try it soon and come back if I have problems; I don't think I will. AndyD
6. Re: Accessing the default printer
- Posted by CChris <christian.cuvier at agricult?r?.gouv.fr> Oct 24, 2007
- 551 views
Andy Drummond wrote: > > Greg Haberek wrote: > > > > Try this: > > > > <a > > href="http://www.freewebtown.com/ghaberek/getDefaultPrinter.ew">http://www.freewebtown.com/ghaberek/getDefaultPrinter.ew</a> > > > > I wrote this a back in March and was planning to submit it to > > Win32Lib. It should probably be included, as it is quite useful. :) > > > > -Greg > > > > On 10/23/07, don cole <guest at rapideuphoria.com> wrote: > > > > > > > > > posted by: don cole <doncole at p?cbell.n?t> > > > > > > > > > hello again Andy, > > > > > > Also see getPrintChoice() > > > > > > Don Cole > > > > > > > Great! thank you, Greg & Don. This is precisely what I wanted. So - CChris, > how about adding this to the printing section of the Win32Lib next issue? > I will try it soon and come back if I have problems; I don't think I will. > > AndyD There's already some code in 70.1 that checks for what the current printer is. I'll check Greg's program and merge it shortly. CChris
7. Re: Accessing the default printer
- Posted by CChris <christian.cuvier at agric?ltu?e.gouv.fr> Oct 24, 2007
- 568 views
CChris wrote: > > Andy Drummond wrote: > > > > Greg Haberek wrote: > > > > > > Try this: > > > > > > <a > > > href="http://www.freewebtown.com/ghaberek/getDefaultPrinter.ew">http://www.freewebtown.com/ghaberek/getDefaultPrinter.ew</a> > > > > > > I wrote this a back in March and was planning to submit it to > > > Win32Lib. It should probably be included, as it is quite useful. :) > > > > > > -Greg > > > > > > On 10/23/07, don cole <guest at rapideuphoria.com> wrote: > > > > > > > > > > > > posted by: don cole <doncole at p?cbell.n?t> > > > > > > > > > > > > hello again Andy, > > > > > > > > Also see getPrintChoice() > > > > > > > > Don Cole > > > > > > > > > > Great! thank you, Greg & Don. This is precisely what I wanted. So - CChris, > > how about adding this to the printing section of the Win32Lib next issue? > > I will try it soon and come back if I have problems; I don't think I will. > > > > AndyD > > There's already some code in 70.1 that checks for what the current printer is. > I'll check Greg's program and merge it shortly. > > CChris v70.1 already defines getPrinterName(), which returns the name of current printer. I'll add this:
--/topic Printing --/func getDefaultPrinter() --/desc Like /getPrinter(), but assumes there is a default printer already installed. --/ret (ATOM) DC for default printer. global function getDefaultPrinter() printerDC = w32Func(xCreateDC,{wsp,pname,0,0}) return printerDC end function
pname holds the string getPrinterName() returns, and wsp holds "WINSPOOL"). CChris NOTE: Derek, you have a lock on win32lib.ew, so that I can't update it in 70.2 using SVN. I didn't attempt to break the lock.