Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetDefaultPrinter
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00659495
Message ID:
00659498
Views:
32
>Hi!
>
>Is there a way to findout the current Default Printer using a Windows API Call or using the Windows Scripting Host. (Not through VFP) in Win98/NT/2000
>
>The Windows Scripting Host gives me a list of printers but does not tell me which Printer from that list is the Default Printer.
>
Sarosh,

The Windows Script Host provides no means to determine the default printer. The API call you're interested in is GetDefaultPrinter()
DECLARE INTEGER GetDefaultPrinter IN Winspool.drv;
  STRING @lpbuffer, INTEGER @lpsize
lcbuffer = SPACE(260)
lnsize = LEN(lcbuffer)
* The call returns non-zero on success
* If zero, call GetLastError() for information
? GetDefaultPrinter(@lcbuffer, @lnsize)
? LEFT(lcbuffer, lnsize - 1)
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform