Hi,
does anyone know how you can change the default printer through code, using the registry api?? Apparently this is the only way of doing things in windows2000
Thanks
Printable View
Hi,
does anyone know how you can change the default printer through code, using the registry api?? Apparently this is the only way of doing things in windows2000
Thanks
There's the SetDefaultPrinter API (gee, are those Microsoft guys imaginative.) It's not on the API Viewer but I think it goes like this
Name is a null-teriminated stringCode:'For Windows 2K Only:
Private Declare Function SetDefaultPrinter Lib "winspool.drv" (Name As String) As Long
Returns 0 if unsuccesful, otherwise returns a non-0 value.
I hope this helps and/or works.
Bye.
me
Yesterday, I've solved the problem myself by using the
registry api. First I get the information about the printers I need with the RegQueryValueEx api, then I set the new printer with RegSetValueEx.
If you ever need the code, just ask
Thanks any way
I would like to see that code.
Thanks
Bill