Jump to content

Closing window?


Recommended Posts

I recently installed Autoit, and tried to make couple of macros. In some occasion I managed to make simple macros, but in this I couldn't find solution.

I have newest version of Autoit, using Windows 10 x64.

I tried to make macro to close the window/application "Tor browser"
It activates the window if it is not active but doesn't close it:

WinActivate("About Tor - Tor Browser")
WinClose("About Tor - Tor Browser")

It doesnt report an error, it executes the macro, but window is not closed.

I also tried Winkill, and to record strokes alt+F4, alt+X... but no luck
Help will be appreciated.

Edited by Robert9
Link to comment
Share on other sites

It would be better if you could post your code.   Otherwise, it is hard to say what is happening.  WinClose should return either a 0 or 1.  When you say you get no error are you getting a 1?  That would mean success and no error. You can double check it this way:

$result=WinClose("About Tor - Tor Browser")

msgbox(0,"Result","This is the result: "&$result)

 

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Link to comment
Share on other sites

I would try again but use WinKill.  What is the result for that?  I would hope it would be blank.  It should only return a 1 if it worked.  Also, have you confirmed you only have one instance of this window / app running?  Check your task manager to confirm.

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Link to comment
Share on other sites

  • Developers

Just add #RequireAdmin at the top of your script to force the script to always run AsAdmin.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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