| |
|
|
| E.T. (11.01.11)
Have time a little bit "gebastelt": CompileMarkSeparation'############### ##########
'Drucker auflisten
'Andreas Miethe * Juni 2003
'##########################
DEF EnumPrinters(7) ! "WINSPOOL.DRV","EnumPrintersA"
DEF GetStandardPrinter(0) Substr$(ReadIni$("WIN.INI","Windows","Device"),1,",")
DEF &PRINTER_ENUM_LOCAL 2
DEF &PRINTER_ENUM_DEFAULT 1
Declare PrinterValues#, Drucker$[], Y&, Old_Standard$, Old_Standard_rest$
DEF GetStandardPrinter2(0) ReadIni$("WIN.INI","Windows","Device")
Proc EnumPrinters
Declare Printername&,Portname&,PrinterName$,PortName$,Attribs&
Declare X&,dwNeeded&,dwReturned&
EnumPrinters(&PRINTER_ENUM_LOCAL,0,5,0,0,ADDR(dwNeeded&),ADDR(dwReturned&))
Dim PrinterValues#,dwNeeded&
Clear PrinterValues#
EnumPrinters(&PRINTER_ENUM_LOCAL ,0, 5, PrinterValues#, dwNeeded&, ADDR(dwNeeded&), ADDR(dwReturned&))
While X& < dwReturned&*20
Printername& = Long(PrinterValues#,x&)
PrinterName$ = String$(Printername&,0)
Attribs& = Long(PrinterValues#,x&+8)
'folgendes funzt bei mir unter XP nicht:
' If Attribs& & $4
' Printername$ = Printername$ + " => Standarddrucker"
' endif
Drucker$[Y&] = Printername$
X& = X& + 20
inc Y&
EndWhile
Dispose PrinterValues#
Endproc
Proc Set_Std_Printer
Parameters PrinterString$
WriteIni "WIN.INI","Windows","Device"=PrinterString$
EndProc
cls
EnumPrinters
Print "Gefundene Drucker"
WhileLoop 0,Y&-1
Print "Drucker " + @str$(&loop) + " : " + Drucker$[&loop]
EndWhile
Old_Standard$ = Substr$(GetStandardPrinter2(),1,",")
Old_Standard_rest$ = Substr$(GetStandardPrinter2(),-2,",") + "," + Substr$(GetStandardPrinter2(),-1,",")
Print "***"
Print "Standard-Drucker :"
Print Old_Standard$
Print "***"
Print "Drucke auf Drucker " + Drucker$[4]
Set_Std_Printer Drucker$[4] + "," +Old_Standard_rest$
StartPrint
DrawText 10,10,"Test " + Drucker$[4]
EndPrint
Print "Drucke auf Drucker " + Drucker$[2]
Set_Std_Printer Drucker$[2]+","+Old_Standard_rest$
StartPrint
DrawText 10,10,"Test " + Drucker$[2]
EndPrint
Print "***"
Print " >>>alten Standart-Drucker wieder einstellen.."
Set_Std_Printer Old_Standard$+","+Old_Standard_rest$
Print "Standard : " + Old_Standard$
Print "***"
Print ""
Print "...warte"
put
end
created by me the following Window (sees nat. each differently from, according to install. Printers...) and functions wonderful. with pdf comes The request "wo speichern", and with Fax becomes to 'ner Fax-number demand. means go The printer correctly. staid. May eachone from it make, what it wants ... |
|
|
| |
|
|
|
Dieter Zornow | with only 3 Printers is printer$[4] naturally not there, therefore is a Errors in the code |
|
|
| Er ist ein Mann wie ein Baum. Sie nennen ihn Bonsai., Win 7 32 bit und Win 7 64 bit, mit XProfan X2 | 01/11/11 ▲ |
|
|
|
|
Jörg Sellmeyer | you mußt absolutely a Link to that Original-Posting reinsetzen You old Sterneabstauber and of course directly to that Posting and not only to that Thread! |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 01/11/11 ▲ |
|
|
|
|
E.T. | |
|
| Grüße aus Sachsen... Mario WinXP, Win7 (64 Bit),Win8(.1),Win10, Win 11, Profan 6 - X4, XPSE, und 'nen schwarzes, blinkendes Dingens, wo ich das alles reinschütte... | 01/11/11 ▲ |
|
|
|