1. Accessing the default printer

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

new topic     » topic index » view message » categorize

2. Re: Accessing the default printer

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

new topic     » goto parent     » topic index » view message » categorize

3. Re: Accessing the default printer

hello again Andy,

Also see getPrintChoice()

Don Cole

new topic     » goto parent     » topic index » view message » categorize

4. Re: Accessing the default printer

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

new topic     » goto parent     » topic index » view message » categorize

5. Re: Accessing the default printer

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

new topic     » goto parent     » topic index » view message » categorize

6. Re: Accessing the default printer

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

new topic     » goto parent     » topic index » view message » categorize

7. Re: Accessing the default printer

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.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu