Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default Printer
Message
 
To
23/10/1997 19:09:50
Lamar Glover
Southeastern Apparel, Inc.
Dothan, Alabama, United States
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Miscellaneous
Thread ID:
00056438
Message ID:
00056957
Views:
45
>Can anyone tell me how to find out what the default printer is from within VFP 5.0
>
>Thanks

Lamar,

This information is kept in both the registry and the WIN.INI file, with the latter being the easier of the two to retrieve information from. Previously you would have had to use the GetProfileString() in the API (and you still can), however, FOXTOOLS has added a hook to this function. Once you've set the library, the following will get you the default printer.

lcsection = 'windows'
lcentry = 'device'
lcdefault = ""
lcbuffer = SPACE(80)
lnbuflen = LEN(lcbuffer)
= GetProStrg(lcsection, lcentry, lcdefault, @lcbuffer, lnbuflen)

The information contained in the buffer will include the printer name, driver, and port or network connection.

hth,

George
George

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

Click here to load this message in the networking platform