Page 1 of 1
How to manipulate other softwares windows (focus, open, clos
Posted: Sat May 30, 2009 7:47 pm
by nonilluminati
How to manipulate other softwares windows (focus, open, close, resize, etc...) ?
Hi,
I searched for quite some time a solution (I'm 100% beginner) to do this without finding any answer.
It may not be possible, althought, I don't think so as I think it is basic programming and knowledge, but I may be wrong.
I can add some details :
Xp system.
I made a really simple script to copy some folders, it's a game config files, from hard disk D to Hard disk C.
Happenning at preload. The stack is made invisible.
A shortcut launch it.
There is only to double click the shortcut to launch the folders copy, without seeing anything because it's fast and small, only a few folders to copy.
Then it launch the game after the files copy.
The stack unload from memory close and exit.
One more thing to do :
Closing the first windows that appears when the game launch it's the end user agreement windows with 2 buttons : Accept and Decline.
I don't know what methods are available to close it, but if it is from mouse clicking or keyboard typing I would choose keyboard which is more reliable.
Anyway I hope there is other ways, because those 2 are usual methods from mouse and keyboard recorder softwares.
They are not very reliable, especially mouse method.
A programming software may offer others choices than those I'm sure.
It is still a windows in XP environment.
I mean, it has not yet switched to the game environment.
That will happen only after closing the end user agreement window.
I just want to accept to close it.
The game will launch after that, automatically.
Is this possible ?
Tanks in advance for reading and enlightning.
Posted: Sun May 31, 2009 1:02 am
by mwieder
You may want to write a little VBScript program to do this if you can identify the windows to be maniuplated. Throw the VBScript into a variable and then "do" the variable "as VBScript". Or you may want to launch an AutoHotKey macro as an alternative.
Posted: Sun May 31, 2009 1:09 am
by WaltBrown
Neat tip, thanks! Looks like you can get at PowerShell that way as well.
Walt
Posted: Sun May 31, 2009 3:13 am
by nonilluminati
mwieder wrote:You may want to write a little VBScript program to do this if you can identify the windows to be maniuplated. Throw the VBScript into a variable and then "do" the variable "as VBScript". Or you may want to launch an AutoHotKey macro as an alternative.
Thank you for the solution!!!
Althought I can't use it : beginner in programming, VBScript level = zero.

I may turn to the second solution : software like autohotkey that I already used a bit. That excited my curiosity and here I am...
Does it means it cannot be done by Revolution or others kinds of programming software (like VB from microsoft) ?
It also means that keyboard and mouse automation software can do things that programming softwares cannot.
It really surprise me.
A lot.
I thought programming softwares were all powerful, really !!!
Poor me.

Posted: Sun May 31, 2009 5:31 am
by mwieder

I think there's no perfect programming tool for all tasks, and one of the things about maturing as a programmer is finding the right tool for the right job.
Rev can't do what you want out of the box, but it does have links to drive other software (see the "launch" command). If you can create an autohotkey macro that does what you want as far as closing the startup window then you can "launch" the macro, let it shut the window, then continue your script. In that way you're using the best features of rev, and combining that with autohotkey doing what it does best.
(and by the way, the vbscript code to do what you want shouldn't be much more complicated than the autohotkey macro).
Posted: Sun May 31, 2009 8:26 am
by Andycal
Check out 'AutoIt'. I've found that between RunRev and this, you can pretty much do anything. The bonus with AutoIt is that it compiles to tiny files, in fact, I began writing one tool in RunRev and ended up doing it all in AutoIt in the end.
Posted: Sun May 31, 2009 9:33 am
by nonilluminati
So, I'll learn a bit of vbscript or jscript (if it can be done in one it can be done in both, right ?)
Althought this road is the most interesting, as human beeing goes it's more than probable that all this finishes along the path of less resistance, doing it with what I already know : autosomething (autohotkey or autoit)...
As you said Andycal, I may end doing it entirely with autoit.
Mmm, I hope I won't say something cataloging me definitely in the beginner frozen stase, here it is :
The bonus of this thread is that maybe this kind of function, interacting outside of the Revolution environement with other windows including the os desktop and windows too, could be added to revolution...
.
Posted: Sun May 31, 2009 10:04 am
by Andycal
I totally agree. The Internet functions of RunRev are woefully restrictive. If you check out the Internet library in AutoIt, it gives an amazing amount of control over forms, submissions, variables etc.
Posted: Sun May 31, 2009 10:29 am
by nonilluminati
From what I already read about Revolution, it has lots of qualities and can piles up more rapidly.

By the way I realize the second part of my question about other kind of programming software hasn't been answered :
nonilluminati wrote:Does it means it cannot be done by Revolution or others kinds of programming software (like VB from microsoft) ?
Posted: Sun May 31, 2009 5:12 pm
by mwieder
It *can* be done in VB, but you'll have to end up (re)creating something like AutoHotKey or AutoIt yourself in VB, and you'll have to learn a lot about the internals of Windows message handling in the process.
Posted: Sun May 31, 2009 5:13 pm
by mwieder
AndyCal- thanks for reminding me about AutoIt. I had forgotten about that one.
Posted: Sun May 31, 2009 5:39 pm
by nonilluminati
Thank you mwieder,
I started a little VB learning, before finding revolution, and I agree when you say
mwieder wrote:you'll have to learn a lot about the internals of Windows message handling in the process.
What I already accomplish with Revolution (this simple little (I can't call it a program) automation thing), I tried before with VB .net studio 2008 : I read a whole book about starting in VB 2008, but realized that to do it I needed much more study...
mwieder wrote:It *can* be done in VB, but you'll have to end up (re)creating something like AutoHotKey or AutoIt yourself in VB
Better use them directly. May be I'll try with vbscript...
But days with 24 h are not long enough :
Where is the property panel, to change day property :
"Global set day property lenght to 365 actual standard days"
Thank you for all the good infos, I learned a little more today.
Posted: Sun May 31, 2009 8:58 pm
by paul_gr
My experience using AutoIt is that it can trigger AV false positives, especially now that AV's use heuristic "guessing" algorithms when looking for "virus like" activity...
.vbs scripts can also have the same problem; depends on what you try to do with them...
Paul
Posted: Mon Jun 01, 2009 7:58 pm
by nonilluminati
I've done it with AutoHotkey it works pretty well, needs more testing to be sure.
Hi paul_gr, I don't have any antivirus, so I cannot test if it'ld trigger false alarm.