Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get the Windows current/default printer?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00587786
Message ID:
00588147
Views:
18
Hi George,

I tried the code with my PC (NT Workstation SP5) and it didn't work, and I would like to use the registry class in the FFC, can you give me some example on it?? 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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform