Jump to content
Sign in to follow this  
AutoItKing

Close all windows?

Recommended Posts

AutoItKing

I can't seem to figure out how to get all active windows to close in Windows. I've expiramented by getting the handels of windows and then closing them. Help please? :o


http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]

Share this post


Link to post
Share on other sites
cdkid

Well, you could do

$list = WinList()
For $i = 1 to $list[0][0]
if BitAnd(WinGetState($list[$i][0]), 2) Then;Is visible
WinClose($list[$i][0])
endif
next

That 'ought to work

~cdkid


AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites
AutoItKing

I got it all worked out. Check the Attachment

[edit] Moved to scripts and scraps! Here

Edited by AutoItKing

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]

Share this post


Link to post
Share on other sites
slightly_abnormal

Hi! Ain't no one gonna try my script? :geek:;):sorcerer::o

the code cd posted i had to restart my machine, it shut down every - single - process

[edit]

really cool, thanks! autoitking, i was hunting for something like this!

Edited by slightly_abnormal

Share this post


Link to post
Share on other sites
slightly_abnormal

[EDIT] :o

hEY, how do I get the handle, and how do I add more than one app to the do not close list?

Edited by slightly_abnormal

Share this post


Link to post
Share on other sites
AutoItKing

the code cd posted i had to restart my machine, it shut down every - single - process

Yup. That's what happened to me too. So i just added in

If $sd_windows[$i][0] <> "" AND BitAnd( WinGetState($sd_windows[$i][1]), 2 ) {{{{AND $sd_windows[$i][0] <> "Program Manager"}}}} Then

That's the title of Explorer. If you use WinKill to close it Windows goes wacky and you have to restart your computer. Pissed me off pretty bad!


http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]

Share this post


Link to post
Share on other sites
AutoItKing

[EDIT] :o

hEY, how do I get the handle, and how do I add more than one app to the do not close list?

Handle? Of What?

And to leave more than just one window open..... Haven't added that yet.

[EDIT]

Okay I added it. You can Have up to three windows left open.

_ShutDown(4,"AutoIt Forums - Microsoft Internet Explorer", "Untitled - Notepad", "untitled - Paint")

Hope that helps! :geek:

Edited by AutoItKing

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]

Share this post


Link to post
Share on other sites
Valuater

Hey, Jon or some one. Can you move this to the Scripts and Scraps section please? :)

just make a post with the pertinant stuff

and without a topic title of a question

8)


NEWHeader1.png

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  

×