|
-
Aug 28th, 2000, 05:18 AM
#1
Thread Starter
Junior Member
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
-
Aug 28th, 2000, 08:29 AM
#2
Fanatic Member
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
Code:
'For Windows 2K Only:
Private Declare Function SetDefaultPrinter Lib "winspool.drv" (Name As String) As Long
Name is a null-teriminated string
Returns 0 if unsuccesful, otherwise returns a non-0 value.
I hope this helps and/or works.
Bye.
me
-
Aug 29th, 2000, 12:56 AM
#3
Thread Starter
Junior Member
registry
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
-
Jan 4th, 2002, 03:33 PM
#4
New Member
I would like to see that code.
Thanks
Bill
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|