Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Default Printer
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Miscellaneous
Thread ID:
00056438
Message ID:
00056975
Views:
29
>>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

set('printer',2) returns the name of the current print device (not always the windows default printer).
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform