Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is the best way to set the Default Printer
Message
From
17/08/2010 15:16:38
 
 
To
17/08/2010 14:33:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00870520
Message ID:
01476892
Views:
61
Try 0 or 2 for minimized if that doesn't work...

>One last thing..
>
>ShellExecute(0, 'printto', lcoutputfile, '"' + lcprinterName + '"', null, SW_HIDE)
>
>My output file is a pdf. So.. the adobe reader get launched to do the print.
>I want the reader to be minimized or hidden.
>
>SW_HIDE does not hide the reader. Is there an integer that will hide or minimize the reader?
>
>
>
>
>>>Yes. It does work. A simple solution. Thanks again.
>>>
>>
>>You're welcome, Debra
>>
>>
>>>>Debra,
>>>>
>>>>>Would you know, off hand, if I can I pass the tray as well?
>>>>
>>>>Not really - but I think there's a way around
>>>>
>>>>I have my same printer added twice, for the second I change the properties to use Black and White printing.
>>>>If I want to print something in black & white, I simply select the Black and white printer
>>>>
>>>>
>>>>I suspect the same will apply to your tray question
>>>>
>>>>(1) Add another printer - eg Printer_Tray_2
>>>>
>>>>(2) Change its properties to use a specific tray - here # 2
>>>>
>>>>
>>>>Now print to printer 'Printer_Tray_2'
>>>>
>>>>
>>>>
>>>>
>>>>>Greg,
>>>>>
>>>>>Thank you so much. The printto in the shell execute is working beautifully.
>>>>>Very very nice...
>>>>>
>>>>>Would you know, off hand, if I can I pass the tray as well?
>>>>>
>>>>>
>>>>>>>It seems to be working if I close adobe and then set the windows system default printer.
>>>>>>>
>>>>>>>How do you suggest I accomplish this task?
>>>>>>>
>>>>>>> I need to print to a bullzip pdf printer first to create a pdf.
>>>>>>>Then, I need to switch to a selected printer to print a hard copy of the pdf.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>Debra,
>>>>>>
>>>>>>I have not followed the whole thread - but try this
>>>>>>
>>>>>>- no need to change the default windows printer
>>>>>>- pass the printer name to ShellExecute as a parameter
>>>>>>
>>>>>>
>>>>>>	declare integer GetDesktopWindow IN win32api
>>>>>>
>>>>>>	Declare long ShellExecute in shell32.dll  ;
>>>>>>		    long hwnd, ;
>>>>>>		    string lpszOp, ;
>>>>>>		    string lpszFile, ;
>>>>>>		    string lpszParams, ;
>>>>>>		    string lpszDir, ;
>>>>>>		    long nShowCmd
>>>>>>			    
>>>>>>	local pdfFile, printerName 
>>>>>>	pdfFile = 'd:\tmp\0xx.pdf'
>>>>>>	pdfFile = 'd:\tmp\aaa.pdf'
>>>>>>	
>>>>>>	printerName = 'HP Photosmart C6100 series'
>>>>>>	&& printerName = 'Bullzip PDF Printer'
>>>>>>	
>>>>>>	
>>>>>>	
>>>>>>	?ShellExecute(GetDesktopWindow(), 'printto', m.pdfFile, '"' + m.printerName + '"', null, 7)
>>>>>>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform