Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get the Windows current/default printer?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00587786
Message ID:
00587921
Vues:
21
>Hi friends! Again with another question, I need to create a select printer dialog box (without using any VFP function) so I can have a default printer and let the user change it if he/she wants to. I would like to know how to get the Windows current printer using some Windows API function.
>
>TIA
>
Luis,

The current default printer is stored in the HKEY_CURRENT_CONFIG\System\CurrentControlSet\Control\Print\Printers\Default key. Since you don't want to use a VFP function, you could use the Windows Script Host to retrieve this value.
oShell = CREATEOBJECT("WScript.Shell")
lcdefaultprinter = oShell.RegRead("HKCC\System\CurrentControlSet\Control\Print\Printers\Default")
Naturally, you could also use the Registry class in the FFC to retrieve this via the API as well.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform