Results 1 to 4 of 4

Thread: Urgent ... Registry

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Location
    Antwerp,Belgium
    Posts
    21

    Question

    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

    God and coincidence are two big humorists

  2. #2
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516
    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
    Courgettes.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Location
    Antwerp,Belgium
    Posts
    21

    Cool 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

    God and coincidence are two big humorists

  4. #4
    New Member
    Join Date
    Jan 2002
    Location
    Winona,MN
    Posts
    10
    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
  •  



Click Here to Expand Forum to Full Width