Jump to content

Closing application by executable or class


Recommended Posts

Hi,

I'm trying to make a script that will close an application (only knowing the executable and class) properly (by send 7 {esc} keys) but am unable to figure out how to do this.

Can anyone point me in the right direction? I tried using controlfocus but I'm unsure if that is the correct command to use in this scenario.

Thanks,

Link to comment
Share on other sites

Do you know the name of the window (if any) it is using?

What about ProcessClose()?

If the window is already active and you just want to send esc 7 times use Send("{ESC 7}")

No, I have no way of knowing what the title of the window. It is a network application and basically if user1 signs on the window will be called TMS_Workstation1 and if user2 signs on it will be called TMS_Workstation2. I don't believe I can use a wild card w/ winactivate can i?

The only issue with using process close is that the application has to be closed properly (with 7 esc keys). If it doesn't close properly, then our backups can not be performed.

I do know the class, and read somewhere that you could focus the window by just knowing the class, but was unsuccessful in my attempts.

-mjg

Link to comment
Share on other sites

Didn't test that before typing it, did'ya? :)

Look in the help file at WinTitleMatchMode:

WinTitleMatchMode

Alters the method that is used to match window titles during search operations.

1 = Match the title from the start (default)

2 = Match any substring in the title

3 = Exact title match

4 = Advanced mode, see Window Titles & Text (Advanced)

-1 to -4 = force lower case match according to other type of match.

The default match is String*.

:D

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...