473,395 Members | 1,761 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Microsft Photo Editor hanges when printo verb is used

Hello,

I have a small piece of code to launch a file and print it to desired printer. The code is as follows:

Expand|Select|Wrap|Line Numbers
  1. objProcess.StartInfo.FileName = "C:\test.jpg";
  2. objProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden | ProcessWindowStyle.Minimized;
  3. objProcess.StartInfo.UseShellExecute = true;
  4. objProcess.StartInfo.CreateNoWindow = true;
  5. objProcess.StartInfo.ErrorDialog = false;
  6. objProcess.StartInfo.Arguments = "HP Lazer Jet 1010";
  7. objProcess.StartInfo.Verb = "Printto";
  8. objProcess.Start();
  9.  
This code works perfect will all files extensions except ".jpg". As soon as i try with ".jpg" Microsoft Photo Editor opens and goes to "not responding" mode.

When I use "print" verb it works well.

I've verified that proper command is given to printto verb in file association.
"C:\Program Files\Common Files\Microsoft Shared\PhotoEd\PHOTOED.EXE" /pt "%1" "%2" "%3" "%4"

If I manually open a jpg file in Microsoft Photo and print; it works well.

I've tried reinstalling the photo editor but no luck. I'm unable to figure out what's the problem with printto verb.

Please help me.

Regards,
Piyush
Jan 5 '10 #1
6 2374
tlhintoq
3,525 Expert 2GB
So your application isn't actually printing anything?
You are just trying to cause any file passed to open in its default application and print?
Is that right?
If it were a text file you assume it will open in NotePad?
If it were a jpg file you assume it will open in MS Photo Editor?
Jan 5 '10 #2
That's right tlhintoq. I'm just trying to open the file passed in its default application and print.
Jan 13 '10 #3
Yes my application causes the file passed to open in its default application and print.
Jan 13 '10 #4
tlhintoq
3,525 Expert 2GB
But you have no way of knowing what program the user has set as the default for a specific type. On your computer the default for a text file might be notepad. For someone else it might be WordPad. For someone else it could be Microsoft word.
When I use "print" verb it works well.
I'm unable to figure out what's the problem with printto verb.
I've never actually tried doing what you are try so please bear with me.
  • If it works with the "print" verb why not go with that?
  • What does "printto" give you that "print" does not?
  • Have you tried changing the default program for that file type to see if a different program will react the way you want to the "printto" command? Maybe it is a bug is that one program.
Jan 13 '10 #5
Hi Tlhintoq,

My idea here is to shell the file and let the application associated with its file extension open the application. That's how it works in Windows as well. File extensions like ".txt", ".doc" etc are associated with some programs and mainly there are three verbs "Open", "Print" and "Printto".

Use can view this in Folder Options-->File Types by clicking the advanced button. Please check the attached file.

I hope it makes it clear.
Attached Images
File Type: jpg folderoptions.jpg (18.1 KB, 225 views)
Jan 14 '10 #6
My answers to the questions:
  • If it works with the "print" verb why not go with that?
    That's because "print" verb doesn't allow choosing printer. It prints on default printer that can be changed any time.
  • What does "printto" give you that "print" does not?
    The answer is same "printto" allows to print the file to a specified printer.
  • Have you tried changing the default program for that file type to see if a different program will react the way you want to the "printto" command? Maybe it is a bug is that one program.
    Yes this works with other programs but my issue is specific to MS Photo Editor. If I change it to any other program it work fine, but i cannot guaranty that user's machine will not have MS Photo editor as it is quite common program.
Jan 14 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Zeroeffect | last post by:
Hello! I have a database with alot of embedded images. The reason for having the images embedded is security. My problem is that it works fine on my computer, but not on my clients computer....
2
by: falk.strobach | last post by:
Hallo, ich habe mir im Access eine Bilddatenbank angelegt. Die Bilder sind als OLE-Objekt (verbunden mit dem Photo Editor) in der Datenbank enthalten. Mit der Umstellung auf MS Office 2003 gibt...
4
by: Michael | last post by:
Dear all .. If I want to use develop a user control and declare a public property which the type is System.Windows.Forms.GridTableStylesCollection For example : Public Class LookAndView...
1
by: Neil | last post by:
I am using ShellExecute to open JPG files with the associated application, MS Photo Editor, from within an Access 2000 application. When the code is run the first time (Photo Editor closed),...
1
by: Throw | last post by:
G'day everyone I'm looking for a simple photo gallery script in PHP (or Perl), but not too simple. I have tried several photo gallery scripts in either language and I have found that they are...
4
by: TomA | last post by:
Hi All, I have a picturebox on a form containing the photo of a person. As you advance through the records, the photo updates. Rather than storing the images in an inefficient blob field in a...
0
by: nkotbox | last post by:
I have this script to enable/disable my wireless nic on my laptop. Is it possible for the scripts icon or shortcut to the script to change icons depending on whether or not the nic is enabled. So if...
25
by: koolj96825 | last post by:
1) Thank you. Thanks to this news group in which I read a post earlier today about making variables static in certain cases, I believe I avoided future debugging headaches. It reminded me of a...
4
by: dclingan | last post by:
OS XP Access 2003 additional program available MS Photo Editor 3 I understand Access 2003 did not come with Photo Editor and such needs to be installed. I have done this. I have inserted a...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.