Results 1 to 8 of 8

Thread: [RESOLVED] How to show the Print Queue dialog and some other printer stuff

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2008
    Posts
    81

    Resolved [RESOLVED] How to show the Print Queue dialog and some other printer stuff

    Hello to everybody
    I am pretty sure I am describing somewhat the wrong way but I can't find a way to show this window via VB6
    pretty much like going to Devices and Printers and double click on the Printer
    Name:  Clipboard01.jpg
Views: 547
Size:  13.5 KB
    I just want to pass the printer name and show this matching dialog .
    Also if is not much bother how I turn "Use Printer Offline"
    Name:  image_2022-03-29_120520423.png
Views: 596
Size:  2.2 KB
    this on and off
    It seems in the Printer API there is more than one offline and I did found how to put the printer to Offline/Online (PRINTER_CONTROL_SET_STATUS) but not how to make
    the switch in the offline usage.

    TIA

  2. #2
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,262

    Re: How to show the Print Queue dialog and some other printer stuff

    Looking in Task-Manager, i see that window is running in a "rundll32"-context....

    going by this: https://docs.microsoft.com/en-us/win...ndll32-printui


    i'd try a "shell("rundll32 printui.dll PrintUIEntry /o /n\\MyHostName\MyPrintername")"
    Last edited by Zvoni; Mar 29th, 2022 at 05:28 AM.
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2008
    Posts
    81

    Re: How to show the Print Queue dialog and some other printer stuff

    Thanks man.. I will check it

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Oct 2008
    Posts
    81

    Re: How to show the Print Queue dialog and some other printer stuff

    Well this was the solution thanks Zvoni
    Code:
    Shell ("rundll32 printui.dll PrintUIEntry /o /n ""name of printer")
    I will wait a bit if someone resolves also the turning on/off

  5. #5
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,262

    Re: How to show the Print Queue dialog and some other printer stuff

    Quote Originally Posted by masteripper View Post
    Well this was the solution thanks Zvoni
    Code:
    Shell ("rundll32 printui.dll PrintUIEntry /o /n ""name of printer")
    I will wait a bit if someone resolves also the turning on/off
    from WIN+R i'd try a
    rundll32 printui.dll, PrintUIEntry /Xg /n"Printer Name"
    and then look for "Status"... play around with it (toggle on/off) with running the command every time

    with the "/Xs"-Switch you can set settings
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Oct 2008
    Posts
    81

    Re: How to show the Print Queue dialog and some other printer stuff

    Quote Originally Posted by Zvoni View Post
    from WIN+R i'd try a
    rundll32 printui.dll, PrintUIEntry /Xg /n"Printer Name"
    and then look for "Status"... play around with it (toggle on/off) with running the command every time

    with the "/Xs"-Switch you can set settings
    Cool .. I was expecting a rather hard API solution but this should do...
    Thanks man

  7. #7
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,262

    Re: How to show the Print Queue dialog and some other printer stuff

    Quote Originally Posted by masteripper View Post
    Cool .. I was expecting a rather hard API solution but this should do...
    Thanks man

    There might be an API-Solution, but at a guess the "printui.dll" was written with "cdecl"-convention, so you might have to jump through some hoops.
    Found this: https://www.pinvoke.net/default.aspx...UIEntryW.html#
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Oct 2008
    Posts
    81

    Re: How to show the Print Queue dialog and some other printer stuff

    Quote Originally Posted by Zvoni View Post
    There might be an API-Solution, but at a guess the "printui.dll" was written with "cdecl"-convention, so you might have to jump through some hoops.
    Found this: https://www.pinvoke.net/default.aspx...UIEntryW.html#
    Thanks again my friend.

Tags for this Thread

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