Welcome to MSDN Blogs Sign in | Join | Help

What printers are available to your program?

The APRINTERS function allows you to enumerate all the printers to which your application can print.

 

 

?"Printer info"

ShowPrinters(0)

?"More printer info"

ShowPrinters(1)

PROCEDURE ShowPrinters(nMode)

      n=APRINTERS(aa,nMode)

      FOR i= 1 TO n

            ?i

            FOR j = 1 TO ALEN(aa,2)

                  ??"---",aa[i,j]

            ENDFOR

      ENDFOR

RETURN

 

 

 

 

Likewise, the ANETRESOURCES function lets you learn what resources are available on the network (see WNetEnumResource), such as available network shares and network printers.

 

 

On my machine, this code

 

cMachine=""

n=ANETRESOURCES(aa,cMachine,1)

FOR i= 1 TO n

      ?i,aa[i]

ENDFOR

 

Produces this output

 

         1 Microsoft Terminal Services

         2 Microsoft Windows Network 

         3 Web Client Network

 

Change the machine name to a machine on your network.

Published Friday, August 26, 2005 1:00 PM by Calvin_Hsia
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Good site

Wednesday, April 30, 2008 11:14 AM by matar_xy

<a href= http://index3.opimol.com >sandler painter artist female inpressionism expressionism</a> <a href= http://index4.opimol.com >music video channels</a> <a href= http://index1.opimol.com >beth chapman dogs wife</a> <a href= http://index2.opimol.com >chinasxxxentertainment</a>

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker