enumerating_20the_20installed_20printers
This is an old revision of the document!
Enumerating the installed printers
by Richard Russell, February 2014
The following program will list the installed printers:
SYS "LoadLibrary", "WINSPOOL.DRV" TO winspool% SYS "GetProcAddress", winspool%, "EnumPrintersA" TO EnumPrinters% SYS EnumPrinters%, 6, 0, 4, 0, 0, ^needed%, ^returned% DIM buffer% needed% SYS EnumPrinters%, 6, 0, 4, buffer%, needed%, ^needed%, ^returned% IF returned% = 0 PRINT "No printers" : END FOR p% = 0 TO returned%-1 PRINT $$!(buffer% + 12*p%) NEXT p%
The names displayed correspond to those which you need to use in the *PRINTER command, so this routine can be useful in avoiding the No such printer error.
enumerating_20the_20installed_20printers.1523981100.txt.gz · Last modified: 2024/01/05 00:17 (external edit)