Page 1 of 1

SetDefaultPrinter library...

Posted: Thu Sep 11, 2008 8:30 am
by Skipsy
Hello all,

Could someone explain how to use Windows SetDefaultPrint function with
PB ???
http://msdn.microsoft.com/en-us/library ... S.85).aspx

I tried :
SetDefaultPrinter_ ("my_printer")
but the compiler returns an error.

By the way... Is there any way to use this function ???

Thks a lot,
William.

Posted: Thu Sep 11, 2008 9:19 am
by Rings
Its a driver, but also export functions like a dll:

Code: Select all

PrinterName.s="Brother HL-1250"
#Lib=1
winspoollib=OpenLibrary(#lib,"Winspool.drv")
Prototype ProtoSetDefaultPrinter(name.s)
 If winspoollib
 
 SetDefaultPrinter.ProtoSetDefaultPrinter=GetFunction(#Lib,"SetDefaultPrinterA")
 Result=SetDefaultPrinter(PrinterName)
 Debug result
EndIf

Posted: Thu Sep 11, 2008 4:52 pm
by Skipsy
Well, I am not sure it's a driver, the goal is not to add a nex printer, just
to define a nex one as default in the existing list.

Iam not sur to understand that code so Iam trying tomorrow.

I was also working on another way :
rundll32 printui.dll,PrintUIEntry /y /n "printer"
but it doesn't work using RunProgram()...

Thks,
WW