AutoHotkey Community

It is currently May 26th, 2012, 7:58 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: June 12th, 2008, 4:17 am 
Offline

Joined: June 12th, 2008, 4:14 am
Posts: 8
Hey, i know i am new, but i have been searching the forums and such, and have been trying to piece together bits of code to do one thing.

I want to make a script that when i press a button, it hides ALL the windows that are currently open (including the minimized ones )

I am trying to make a sort of panic button for my girlfriend. Her mom doesnt like her on myspace and such, and instead of her just minimizing it, i think this will be a lot easier to work with (because then i can have the script open up some other web page or program)

thanks for your help


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 12th, 2008, 5:23 am 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
WinGet, List
Loop, Parse
WinHide

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 12th, 2008, 5:32 am 
Offline

Joined: June 12th, 2008, 4:14 am
Posts: 8
any chance you could help me out by making a sample script?

i am sorry, i am just very new at this... i started learning to help out my dad, and i made a program to launch another program after a certain period of time... but that is the most i have done... so i am a very large noob.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 12th, 2008, 5:45 am 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
we all start as newbs. In general, we will help fix code faster than we will write it from scratch. Handing you code does not always help you learn it. By even attempting to write pseudo-code, you show us that you want to learn. you should read some of the posts of people that just want working code provided and don't want to do anything to fix it when it doesn't work as expected.

WinGet, List will return an array of all available windows

Loop will go through each item in the list (use `n as the delimiter)
(Loop parse was the wrong suggestion)

WinHide is the command you want to apply to the list


you will also want to learn about detecthiddenwindows, and don't forget to make a way to bring the windows back!

Code:
#Esc::   ; press Windows+Escape to activate

WinGet, Window, List

Loop, %Window%   ;Window contains the number of windows
{
  ;this is a good place to put an if statement to filter windows!
  WinHide, % "ahk_id " Window%A_Index%

}
return


read it carefully before running. save everything in case you need to reboot to get teh windows back!

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 12th, 2008, 6:26 am 
Offline

Joined: June 12th, 2008, 4:14 am
Posts: 8
well i have gotten it to go away, and to come back. but when it comes back.... it brings EVERY OTHER hidden window with it.. I am still reading about the if statements, so i will try to fix those. Anything else you might want to tell me to point me in the right direction?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 12th, 2008, 7:24 am 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
you can bring back only windows you hid if you keep track of the variables. for each window (before you hide it), check to see if it is visible. If it is, store it's id in a variable, then when you go to show again, you can unhide based on the saved ids instead of getting the window list again.

post your code and we can modify it to help

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 12th, 2008, 10:03 am 
Offline

Joined: June 12th, 2008, 8:02 am
Posts: 12
Just press Windows+D

This hotkey is already built into windows


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 12th, 2008, 1:43 pm 
Offline

Joined: April 17th, 2007, 1:37 pm
Posts: 761
Location: Florida
I've always used #+M and Shift #+M, but those don't hide the taskbar buttons.

_________________
[Join IRC!]
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: poserpro, sjc1000 and 61 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group