need photoeditor to come up tiled

G

Gary Roach

i'm writing a vba app and i need to invoke photoeditor with a number of file
names on the command line and for it to bring them up tiled. how do i do
this? thanks for any help

gary
 
A

Andrew Cushen

Gary-

I don't know about doing it directly- have you checked the
PhotoEditor Help for command-line options?- but you could
always do the actions in PhotoEditor, write down the
ketboard shortcuts, and then use SendKeys to
programmatically issue the keyboard shortcut commands.
This should work quickly enough that it is just about
invisible to the user.


Hope that helps,

-Andrew
====================
 
G

Gary Roach

thanks the sendkeys idea worked great!

Andrew Cushen said:
Gary-

I don't know about doing it directly- have you checked the
PhotoEditor Help for command-line options?- but you could
always do the actions in PhotoEditor, write down the
ketboard shortcuts, and then use SendKeys to
programmatically issue the keyboard shortcut commands.
This should work quickly enough that it is just about
invisible to the user.


Hope that helps,

-Andrew
====================
 
G

Gary Roach

do you happen to know how to find out if the app (photo editor) is ready to
take the keystrokes? right now i'm just delaying with "sleep" from kernel32.
 
A

Andrew Cushen

Gary-

I don't know for sure if this will work, but you could try
the SendMessage API function:

Public Declare Function SendMessage Lib "user32"
Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As
Long, ByVal wParam As Long, lParam As Any) As Long

This function sends a message to a window, then waits for
an answer. Seems to me that if a Window is able to reply,
it's probably ready for keystrokes- but I'm really not
sure.

For more info on calling this function, see AllAPI.net:

http://www.mentalis.org/apilist/SendMessage.shtml

There is a link near the middle of the page for an example.

IN FACT, if you look at the HotKey example, it may do
everything you need IN ONE STEP!!! It looks like it will
send the hotKey and wait until it's processed! So you may
be able to skip SendKeys entirely, and get what you want
in one function!!

Hope this does the trick,

-Andrew
===========================================
 

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

Top