Welcome Guest.   Make a donation to an author on the site September 03, 2014, 02:09:36 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
View the new Member Awards and Badges page.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: want to invoke PrinterDialog, using -setprinter?  (Read 1782 times)
towser
Participant
*
Posts: 3

View Profile Give some DonationCredits to this forum member
« on: July 12, 2012, 06:43:47 AM »

Hello.
I am currently trying to make a command line batch file using MiniCap.
What i intend to do is simply capture the active window, and invoke the printing dialog.
Automatically print does of course work using "-print", but only invokes the default printer.

Is it possible to somehow invoke the Windows PrintingDialog, and select the desired printer?
-- either using MiniCap or using win batch code
If yes, how would i use it in the batch file?

My code so far in "mcprint.bat" (as mentioned, nothing special):

Quote
@echo off
"\MiniCap.exe" -captureactivewin -print -exit


Thank you for your time!
-towser
Logged
Ath
Supporting Member
**
Posts: 2,202



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: July 12, 2012, 07:51:21 AM »

Changing the default printer can be done using rundll32 like this:
Formatted for Text with the GeSHI Syntax Highlighter [copy or print]
  1. rundll32 printui.dll,PrintUIEntry /y /q /n "Printer name"

Source

Some more info on PrintUI can be found here
Logged

towser
Participant
*
Posts: 3

View Profile Give some DonationCredits to this forum member
« Reply #2 on: July 12, 2012, 08:16:38 AM »

thank you so much for your reply!
thought it could be "easier" than using rundll32
will do some reading now and use that ;)
Logged
mouser
First Author
Administrator
*****
Posts: 33,295



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: July 12, 2012, 09:32:47 AM »

Ath's solution may work and is a good general solution when you need to set the default printer for any app,

BUT you are using MiniCap, which has a way to specify the printer to use and does not require changing the default printer.

From the MiniCap help file, pass commandline option "-setprinter" as follows:

-setprinter PRINTERNAME
sets a specific printer for printing (to get a list invoke -setprinter list); you can use the full name or a substring

Logged
towser
Participant
*
Posts: 3

View Profile Give some DonationCredits to this forum member
« Reply #4 on: July 26, 2012, 04:07:43 AM »

hello again.
i had found "-setprinter list" before, but had trouble using it, as it would not produce any result, or "list" at all on execution, but only after i was "done" doing the screenshot, and had my batch file completed.
what i intend to do is
- automatically take a screenshot of the fullscreen, or last active window
- print this
- for printing use the default fancy gui that you get when you want to print any image under windows, and have the printer selected manually within this gui

meaning i would rather not like to pass the printername on commandline, but have the user select it manually after the screenshot has been taken
i suppose i could use "run" as commandline, and define the printing gui as parameter, if there was something like this...
or alternatively, copy the screenshot to clipboard, and invoke the printing gui using this clipboard?

-regards
Logged
mouser
First Author
Administrator
*****
Posts: 33,295



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: August 12, 2012, 01:33:22 PM »

what about using the MINICAP commandline option:
-printpreview

that should present a print preview dialog and let user choose printer.
« Last Edit: August 12, 2012, 01:46:58 PM by mouser » Logged
mouser
First Author
Administrator
*****
Posts: 33,295



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: August 16, 2012, 11:33:17 PM »

to clarify, if you pass the -printpreivew commandline option in addition to the -print option, you will get the print preview dialog prior to printing; there you will find a Setup Printer button to change the target printer from the default.
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.031s | Server load: 0.16 ]