Jump to content

Help with Active Window


Recommended Posts

I have a program running that needs to be close properly every night so that a database can be maintained and backed up. The problem I'm having is that windows thinks that the window is active, then sends the command to shut it down but the window is not fully active. The script will bring the window to the front, but it is not highlighted. The command is sent to shut it down, but it does not. I don't want to just close the window because it might corrupt the database. Any help would be greatly appreciated.

automate.txt

Link to comment
Share on other sites

ControlSend works just as good as the Send command. My problem is when I do a WinActivate, the window gets focus but is not fully active. The window is brought to the front, but is not highlighted. I tried looping WinActivate with WinActive to make sure the window gets full focus, but it doesn't work. What am I missing?

Link to comment
Share on other sites

  • My understanding of your problem is that you are trying to close a program window. Assuming that Control-X will close the window, I suggested that you use ControlSend so the window does not need to be active.
  • Can you activate it with the Alt-Tab method? If so there is a that may give you a chance.
  • Just out of curiosity, have you experimented with WinSetonTop?
  • Does hitting Alt-X close the windowor both the window and the program?
Link to comment
Share on other sites

Thanks for the response. I was over thinking it way to much. I was using more commands than I needed to use. Instead of using WinActivate, WinActive, and WinExists to do what I wanted, I should have just used ControlSend. It works just fine everytime. Thanks again.

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...