How do I also set the size and position of the window?
The script I'm currently using is:
dim GuitarProPath
GuitarProPath = """C:\Program Files\Guitar Pro 5\GP5.exe"""
set Shell = WScript.CreateObject("WScript.Shell")
shell.run GuitarProPath
wscript.sleep(2000)
shell.sendkeys "% r" '...restore
Thanks for any help,
Grant
You can't do that unless the program provides some
kind of command line option for it. Those details are
controlled internally.
GrantSt wrote:
> How do I also set the size and position of the window?
>
There are two possibilities.
1. If you don't mind using a 3rd-party control, then
try autoitX.
2. There is also a "pure" script method, which can cause
a great deal for angst, but may get the job done.
If the app has a "system menu" (commonly if an app has a
logo icon in the its window's upper left corner, then it
supports a system menu). First appactivate the window
you wish to move/size. Then using sendkeys, sent an
alt-space combination to bring up the system menu.
Then for move send alt-m, for size send alt-s. If using
sendkeys, this may be alt-space-m, or alt-space-s.
For either move or size the frame of the window will show
a wide gray border.
For move, send a down or up arrow to more the window down
or up, and send a left or right arrow to move the window
left or right. Send a cr to stop this.
For size, you should see a "four Arrow icon" (a.k.a. a
N-E-S-W icon) in the center of your (active) window. Then
if you send an up arrow, you will see a N-S arrow appear
on the top border, sending a down arrow will give you a N-S
arrow on your bottom border. Then you can move the top or
bottom of the window with up or down arrows. Send a cr to
stop this. Likewise, starting with the NESW cursor, you can
send a left arrow to move the left border and a right arrow
to move the right border.
This is more easily done from the keyboard, but you may also
(after using plenty of enabling profanity) be able to eventually
achieve this from script.
cheers, jw
____________________________________________________________
You got questions? WE GOT ANSWERS!!! ..(but, no guarantee
the answers will be applicable to the questions)
Thanks for the reply, I would have got back sooner but for some reason I
didn't get a notification email. I already have a program called Girder that
I've used previously for sending window messages when remote control signals
are received. So while I've managed to set it up to restore, move and size
the window, in response to a pressing specific keys. that program doesn't
seem to have any kind of ordering or delay facilities so I can't use it to
load the program and then set the size.
I guess I was wondering if there was a way of using VBScript to size and
position windows the same way third party programs do.
Anyway I'm going to look into using autoitX or a similar program.
Thanks,
Grant