Sign in to follow this  
Followers 0
zthaynes

Don't have it yet (but might get it if it will work)

7 posts in this topic

Hello all!

Before I get started let me say that I am aware of the etiquette that is expected in these forums, and I am also aware that many of you will shun this post immediately. I do not have AutoIT yet. I have however been searching for a starting point for a script that will accomplish two or three simple (or not so simple) tasks.

1 Open an application that always starts in the middle of the screen

2 Move that applications window to the bottom left location on the screen

3 Lock the position of the applications window (this is not necessary but it would be nice)

That being said, I have found several posts on several VBS forums talking about finding the applications id and using that to move it. In the spirit of fair play, I have found out how to do the first part of the script:

Set ws = WScript.CreateObject("WScript.Shell")

ws.run """C:\Program Files\Meditech\MagicCS\Client\VMAGIC.exe"""

I was finally referred here (to AutoIT) as a better alternative to VBS to accomplish this task. The little bit I know about VBS (which is almost nothing) dwarfs what I know about this program. Heck... I didn't even know AutoIT existed until about 5 minutes ago. I will gladly d/l the program If I can figure out how to use it, but first I need to know is what I want possible with AutoIT? Second, after I look around for examples for a week with no luck, is there anyone that can help me accomplish my goals???

** By the way, the purpose of this is to create a work area that has an unobstructed view of an active desktop page that contains important information for the user of the program

Posted Image

BIGGER PICTURE

Thank's

Zach

Share this post


Link to post
Share on other sites



@zthaynes

Welcome to the forum,

This is a very nice and supportive community and everyone honest and willing to give AutoIt a try is more than welcome.

As long as you are obeying the forum's rules and you are proving to work on your code you will get alot of help; there are many great people around ready to help.

To answer your questions about what you need: yes - AutoIt can do all that and a whole lot more.

Give it a try and start with some very simple examples - you will see that it is not difficult to learn how to do simple things. I'm simply loving it :)

I have discovered this place more than 2 years ago and I never quit. Now AutoIt has an important place in my life :)

As I said, try it and ask for help if you don't understand something.

The most important helper: AutoIt help file !!

Good luck


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

OK... You are right... this thing is awesome!!!

It took me a few minutes to figure it out, but I already have the basis of the script locked down. Here is what I have so far:

RUN ("C:\Program Files\Meditech\MagicCS\Client\VMAGIC.EXE")
WinWaitActive("Meditech Health Care Information System", "Select MEDITECH Universe")
WinMove ("Meditech Health Care Information System", "Select MEDITECH Universe", 0, 80)

That's two out of the three things I needed. I can't quite seem to find a way to lock the window down tho... any ideas???

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

OK... You are right... this thing is awesome!!!

It took me a few minutes to figure it out, but I already have the basis of the script locked down. Here is what I have so far:

RUN ("C:\Program Files\Meditech\MagicCS\Client\VMAGIC.EXE")
WinWaitActive("Meditech Health Care Information System", "Select MEDITECH Universe")
WinMove ("Meditech Health Care Information System", "Select MEDITECH Universe", 0, 80)

That's two out of the three things I needed. I can't quite seem to find a way to lock the window down tho... any ideas???

Congrats on figuring things out. :) For your last thing, Check out WinSetState and see if disabling the window's what you want. Edited by exodius

Share this post


Link to post
Share on other sites

@SW_LOCK only seems to work for user created GUI's and not external app windows. If I use disable the window stays still, but you can't use it and you have to ctrl+alt+del to close it.

Maybe this can't be done on an external window

Share this post


Link to post
Share on other sites

Hi there. Check out the FAQ sticky in this forum. I posted a scrap that runs a program and used the programs handle to control the window. It is a more reliable method than using titles IMO- that is if you use AutoIt to start the program.

Also, if you follow that example I posted, try WinSetState ($hWND, @SW_DISABLE)

Cheers,

Brett

Share this post


Link to post
Share on other sites

Another solution is to have the window move to your desired position whenever it is moved elsewhere.

An inconvenience of this method is that you need your script to run always in the background.

Have a look at this script:

Run("calc.exe")
Sleep(500)      ;a small sleep
WinMove("Calculator", "", 400, 400)


While 1
    Sleep (500)
    If WinExists("Calculator", "") Then                 ;if the window exists
        $win_pos = WinGetPos("Calculator")              ;get its position
        If $win_pos[0] <> 400 And $win_pos[1] <> 400 Then;if position different
            WinMove("Calculator", "", 400, 400)         ;move it back
        EndIf
    Else
        Exit        ;if window doesn't exist then close the script
    EndIf
WEnd

You can play with the Sleep time in the while loop.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0