| View previous topic :: View next topic |
| Author |
Message |
eternalcold
Joined: 12 Jun 2008 Posts: 8
|
Posted: Thu Jun 12, 2008 3:17 am Post subject: how to hide all windows at once |
|
|
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 |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Thu Jun 12, 2008 4:23 am Post subject: |
|
|
WinGet, List
Loop, Parse
WinHide _________________
(Common Answers) |
|
| Back to top |
|
 |
eternalcold
Joined: 12 Jun 2008 Posts: 8
|
Posted: Thu Jun 12, 2008 4:32 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Thu Jun 12, 2008 4:45 am Post subject: |
|
|
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! _________________
(Common Answers) |
|
| Back to top |
|
 |
eternalcold
Joined: 12 Jun 2008 Posts: 8
|
Posted: Thu Jun 12, 2008 5:26 am Post subject: |
|
|
| 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? |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Thu Jun 12, 2008 6:24 am Post subject: |
|
|
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 _________________
(Common Answers) |
|
| Back to top |
|
 |
stimresp
Joined: 12 Jun 2008 Posts: 12
|
Posted: Thu Jun 12, 2008 9:03 am Post subject: |
|
|
Just press Windows+D
This hotkey is already built into windows |
|
| Back to top |
|
 |
Rhys
Joined: 17 Apr 2007 Posts: 761 Location: Florida
|
Posted: Thu Jun 12, 2008 12:43 pm Post subject: |
|
|
I've always used #+M and Shift #+M, but those don't hide the taskbar buttons. _________________ [Join IRC!]
 |
|
| Back to top |
|
 |
|