Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,

I added a key to the Registry such that when I right click on a JPG file I see a new "Transform" option that actually runs my application.
I would like to implement a Progress Bar to see the progress of the Transformations of all JPGs.
The problem is when I select N JPGs and apply "Transform" on them, my application runs N times (each time with one selected JPG). This way, in my application I can be aware of a single Transformation progress only.
Could you suggest a workaround to implement the Progress Bar ? (maybe to create some temporary file, or something like that...?)

Thanks !
Posted

Why don't you pass all of the selected files on the command line and start a transform thread for each one (use a thread pool). Then, you could have a progressbar for each file, or just one that somehow shows the combined progress. I imagine you've already written a shell extension that adds a menu item to the Explorer context menu.
 
Share this answer
 
v2
I dont think you cant send n nos of arguments. You can pass only the nos of arguments that you mention in the registry using %.
%l actually represents the path which you pass while calling the process.

The possible way out might be, I think you need to device your application in such a way that it will detect if the any other process is going to run when one process is already loaded. You might detect if there is already one appliction is running, and device your application in such a manner that evertime the other instance opens, it just puts the path in some shared location and destroy itself. I think most of the application which opens multiple files all at a time uses this technique.

:cool:
 
Share this answer
 
I did added the shell extension. I put there "my_application.exe %1".
This way only one file passed each time.
How can I pass all of the selected files on the command line ?
Thanks !
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900