Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Description of API in win32API
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00272307
Message ID:
00274156
Views:
52
>Thank you very much for your answer.
>
>I do not know if it is a printer property, but the only think i want to set is to define a printer to become the "Defaul printer" so the user can print whithout to have to select the printer.
>
>such like if i right click on a printer in the printer windows and then click on
>defin as default (in french définir par défaut)

Hi Francis,

My first thought is why not use SET PRINTER TO NAME...? The advantage here is that it only impacts VFP, and not the machine's normal settings.

Beyond that, there are two ways to change the default printer. Both involve the API.

The old way is to change the device= setting in WIN.INI in the [windows] section. Once that's done call SendMessage() to tell all the open applications to reload the section. My INIFiles class in the download section (Win32 and other APIs) does this automatically.

The recommended way is to change the registry setting under HKEY_CURRENT_CONFIG\System\CurrentControlSet\Control\Print\Printers. The default entry there controls the current default printer. After it's changed, you'll have to use SYS(3056, 1) to force VFP to re-read the registry settings.
George

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

Click here to load this message in the networking platform