Hola amigos, estoy usando la función SetPrintDefault para establecer la impresora por defecto en el sistema. Hasta ahora bien pero con Windows 10 y la última actualización no tiene efecto.
¿Alguna solución?
Gracias,
SetPrintDefault no funciona en Windows 10 (solucionado)
- AngelSalom
- Posts: 727
- Joined: Fri Oct 07, 2005 7:38 am
- Location: Benicarló (Castellón ) - España
- Has thanked: 1 time
- Contact:
SetPrintDefault no funciona en Windows 10 (solucionado)
Last edited by AngelSalom on Tue Oct 04, 2016 3:51 pm, edited 1 time in total.
Angel Salom
Visionwin Software - https://www.visionwin.com
------------------------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.4
Visionwin Software - https://www.visionwin.com
------------------------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.4
- AngelSalom
- Posts: 727
- Joined: Fri Oct 07, 2005 7:38 am
- Location: Benicarló (Castellón ) - España
- Has thanked: 1 time
- Contact:
Re: SetPrintDefault no funciona en Windows 10
Sigo, en server 2008,2012 con usuarios que no son propietarios del ejecutable tampoco. ¿Me huelo un tema de permisos?
El código de SetPrintDefault parece que modifica valores del registro ...
El código de SetPrintDefault parece que modifica valores del registro ...
Code: Select all | Expand
function SetPrintDefault( cModel )
local cDriver := StrToken( GetProfString( "Devices", cModel, "" ), 1, "," )
local cPort := StrToken( GetProfString( "Devices", cModel, "" ), 2, "," )
WriteProfString( "Windows", "Device", cModel + "," + cDriver + "," + cPort )
return nil
Angel Salom
Visionwin Software - https://www.visionwin.com
------------------------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.4
Visionwin Software - https://www.visionwin.com
------------------------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.4
- karinha
- Posts: 7935
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: SetPrintDefault no funciona en Windows 10
Mira se ayuda:
Code: Select all | Expand
FUNCTION DefaultPrinter()
LOCAL nPrn, nRet
/*
GetPrintDC( GetActiveWindow() )
SetDefaultPrinter( PRNGETNAME() )
*/
nRet := PrinterSetUp()
nPrn := PrnGetName()
IF( nRet # 0 )
SetDefaultPrinter( PRNGETNAME() )
MsgInfo( OemToAnsi( "Aten‡Æo Usu rio: " )+CRLF+ ;
OemToAnsi( "Sua Impressora DEFAULT(PadrÆo) ‚: " )+CRLF+ ;
( "-> " + nPrn ), ;
OemToAnsi( "Sua Impressora DEFAULT(PadrÆo) ‚... " ) )
ELSE
MsgInfo( OemToAnsi( "ATEN€ÇO USUµRIO: " )+CRLF+ ;
OemToAnsi( "VERIFIQUE SUA IMPRESSORA SE ESTµ LIGADA. " )+CRLF+ ;
OemToAnsi( "OU SE ESTµ INSTALADA CORRETAMENTE... " )+CRLF+ ;
OemToAnsi( "TEM ALGUMA COISA ERRADA COM A IMPRESSORA?" )+CRLF+ ;
OemToAnsi( "TECLE <ENTER> PARA CONTINUAR... " ), ;
OemToAnsi( "VERIFIQUE SUA IMPRESSORA SE ESTµ LIGADA. " ) )
RETURN( .F. )
ENDIF
RETURN NIL
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
- AngelSalom
- Posts: 727
- Joined: Fri Oct 07, 2005 7:38 am
- Location: Benicarló (Castellón ) - España
- Has thanked: 1 time
- Contact:
Re: SetPrintDefault no funciona en Windows 10
Magnífico karinha, sustituyendo SetPrintDefault por SetDefaultPrinter se solucionó.
Angel Salom
Visionwin Software - https://www.visionwin.com
------------------------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.4
Visionwin Software - https://www.visionwin.com
------------------------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.4