>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