Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Terminal services printing issue
Message
De
17/04/2007 16:13:05
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01216955
Message ID:
01217024
Vues:
11
>>>>I don't see simple solutions anymore. So there are two more complicated (just a bit).
>>>>The first one would be to reset Windows default printer (programmatically), and then use Set Printer To Default command. Would you like to try?
>>>
>>>I'll play around with some work-arounds a bit. I don't hold much hope, however.
>>>Thanks for your assistance.
>>>Allen
>>
>>It seems you misunderstood. Do you want to get code how to switch Windows printer programmatically so you will use it and then SET PRINTER TO DEFAULT in your code?
>
>Oh. yes thanks.
>Allen
Function resetwindowsprinter
Lparameters cPrintername
If printerexist(cPrintername)=.F.
	Return .F.
Endif
Declare Integer SetDefaultPrinter In WINSPOOL.drv String
If SetDefaultPrinter(cPrintername)<=0
	Clear Dlls
	Return .F.
Endif
Clear Dlls
Return .T.
Endfunc

Function printerexist
Lparameters cPrintername
Local nLoop
Local Array aTemp(1)
If Empty(cPrintername)
	Return .F.
Endif
If Aprinters(aTemp)<=0
	Return .F.
Endif
For nLoop=1 To Alen(aTemp,1)
	If Upper(Alltrim(aTemp[nLoop,1]))==Upper(Alltrim(cPrintername))
		Return .T.
	Endif
Endfor
Return .F.
Endfunc
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform