>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
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