unix guy needs win32 API help

I

ivowel

dear perl experts---I hope this is a request for a one-liner. I
usually run linux or OSX, but I now am in need of automating some OCR
on Windows. (The OCR vendors only sell affordable software on Windows
in their latest versions.) So, I want to automate the following:

* in the file explorer, right-click on a file [whose name my perl
program provides] and select a particular program to invoke on this
file. For example, this could be "Send To -> Compressed (zipped)
Folder" or "Send to Mail Recipient". In my specific case, I want to
right-click a file to "Abby Finereader -> Convert into ..." or
"OmniPage 16 -> Convert to PDF". Fortunately, there is nothing else
that these invoked programs require as subsequent input.

Then I want to wait until the invoked program is completed and
exits. This is it.

I can write the rest of the program.

Could someone in the know please help?

sincerely,

/iaw
 
M

Martijn Lievaart

dear perl experts---I hope this is a request for a one-liner. I usually
run linux or OSX, but I now am in need of automating some OCR on
Windows. (The OCR vendors only sell affordable software on Windows in
their latest versions.) So, I want to automate the following:

* in the file explorer, right-click on a file [whose name my perl
program provides] and select a particular program to invoke on this
file. For example, this could be "Send To -> Compressed (zipped)
Folder" or "Send to Mail Recipient". In my specific case, I want to
right-click a file to "Abby Finereader -> Convert into ..." or "OmniPage
16 -> Convert to PDF". Fortunately, there is nothing else that these
invoked programs require as subsequent input.

Nothing perlisch here, just create the appriopriate shortcut in the
SendTo folder.

If you really want to modify the context menu, ask in a Windows oriented
group.

HTH,
M4
 
B

Ben Bullock

* in the file explorer, right-click on a file [whose name my perl
program provides] and select a particular program to invoke on this
file. For example, this could be "Send To -> Compressed (zipped)
Folder" or "Send to Mail Recipient". In my specific case, I want to
right-click a file to "Abby Finereader -> Convert into ..." or
"OmniPage 16 -> Convert to PDF". Fortunately, there is nothing else
that these invoked programs require as subsequent input.

Then I want to wait until the invoked program is completed and
exits. This is it.

As Martijn Lievaart mentioned, this isn't a Perl problem. Altering the
behaviour of the right-click menu in "Explorer" is to do with the Windows
registry. (You can alter the Windows registry via Perl but it isn't
necessary to do so to solve this problem.) The following blog post
describes how to add an Emacs command to the right click menu:

http://linuxtnt.wordpress.com/2008/03/06/

I expect you can adjust this to your problem easily.
 
B

Ben Morrow

Quoth Ben Bullock said:
* in the file explorer, right-click on a file [whose name my perl
program provides] and select a particular program to invoke on this
file. For example, this could be "Send To -> Compressed (zipped)
Folder" or "Send to Mail Recipient". In my specific case, I want to
right-click a file to "Abby Finereader -> Convert into ..." or
"OmniPage 16 -> Convert to PDF". Fortunately, there is nothing else
that these invoked programs require as subsequent input.

Then I want to wait until the invoked program is completed and
exits. This is it.

As Martijn Lievaart mentioned, this isn't a Perl problem. Altering the
behaviour of the right-click menu in "Explorer" is to do with the Windows
registry.

I believe (but ICBW) that this is not what the OP is asking. I think he
is trying to *invoke* an existing right-click option on a given file.
For ordinary options (those in the first section of the menu, and those
in Send To) this is easy: just incoke the appropriate command with the
appropriate options. For those provided by dlls, this is much harder,
and I'm afraid I don't know of any easy way to do it. I would advise
checking the documentation of your OCR programs to be sure they don't
provide some sort of command-line interface.

Ben
 
I

ivowel

Quoth Ben Bullock <[email protected]>:


* in the file explorer, right-click on a file [whose name my perl
program provides] and select a particular program to invoke on this
file. For example, this could be "Send To -> Compressed (zipped)
Folder" or "Send to Mail Recipient". In my specific case, I want to
right-click a file to "Abby Finereader -> Convert into ..." or
"OmniPage 16 -> Convert to PDF". Fortunately, there is nothing else
that these invoked programs require as subsequent input.
Then I want to wait until the invoked program is completed and
exits. This is it.
As Martijn Lievaart mentioned, this isn't a Perl problem. Altering the
behaviour of the right-click menu in "Explorer" is to do with the Windows
registry.

I believe (but ICBW) that this is not what the OP is asking. I think he
is trying to *invoke* an existing right-click option on a given file.
For ordinary options (those in the first section of the menu, and those
in Send To) this is easy: just incoke the appropriate command with the
appropriate options. For those provided by dlls, this is much harder,
and I'm afraid I don't know of any easy way to do it. I would advise
checking the documentation of your OCR programs to be sure they don't
provide some sort of command-line interface.

Ben


Exactly. I really want to write a sub in Perl that does exactly the
same as right-clicking by hand would achieve. Yes, these menu options
are provided by programs. (I used "Send to" as an illustration,
because everyone has seen what it is.)

In some sense, all that I need is something like

my $process = $somefilename->rightclick("OmniPage 16", "Convert to
Pdf"); # do the same thing as a hand-rightclick first on OmniPage16
and then its submenu Convert to pdf"
wait($process); # wait until it completes

That's it. Does anyone know?

/iaw
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top