Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SetDefaultPrinter
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00739183
Message ID:
00739251
Views:
18
>Hi!
>
>Currently I use the Windows Scripting Host (WSH) to let the user set any printer as the Windows Default Printer by using the following function.
>
>Function SetWindowsDefaultPrinter(lcPrinter)
>Local WshNetwork
>
>WshNetwork = Createobject("WScript.Network")
>WshNetwork.SetDefaultPrinter(lcPrinter)
>
>Endfunc
>
>I would like to know what the Windows API equivalent Call would be and if that API Call is the same under Win95, Win98, NT, W2k and XP the reason being that the WSH may not be installed on all PC's as many are runnig Win95.
>
>Thanks
>
Sarosh,

Under Win2K/XP, the API function is SetDefaultPrinter(). The syntax for this would be:
DECLARE INTEGER SetDefaultPrinter IN Winspool.drv;
  STRING @lpprintername
IF SetDefaultPrinter(@lcprinter) # 0
  * It was set
ENDIF
In earlier versions of Windows, however, you'd changed the setting in the WIN.INI file and then broadcast the change. The entry in question here is the DEVICE= entry in the Windows section. My Inifiles program in the download section can handle these details for you automatically.
George

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

Click here to load this message in the networking platform