AutoHotkey Community

It is currently May 26th, 2012, 7:34 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: May 7th, 2009, 9:43 pm 
Offline

Joined: December 22nd, 2008, 9:02 am
Posts: 9
It is driving me crazy. May be I am to dump!


What it should do:
Button on MyWindow (AutoHotkeyGUI) should minimize all windows except the MyWindow itself.


What it does:
It is minimizing MyWindow also.


Question:
What can I do to get the desired behavior?


Code:
;-----------------------------
   Gui, Add, Button, w200 gHide, Hide Windows
   Gui, Add, Button, w200 gShow, Show Windows
   Gui, Show, , MyWindow
   Return
;-----------------------------
   Hide:
   WinGet, id, list,,,
   Loop, %id%
   {   
      this_id := id%A_Index%
      WinGetClass, this_class, ahk_id %this_id%
      WinGetTitle, this_title, ahk_id %this_id%
      If (this_class <> "Shell_TrayWnd") and (this_class <> "Button") and (this_class <> "Progman") and (this_class <> "AutoHotkeyGUI") and (this_title <> "MyWindow")
      {
         MinWin=|%this_class% %this_title%%MinWin%
         WinSet, Transparent, 0, ahk_id %this_id%
         WinMinimize, %this_title%
         WinSet, Transparent, 255, ahk_id %this_id%
      }
      Else
      {   
         UntouchedWin=|%this_class% %this_title%%UntouchedWin%
      }
   }
   MsgBox ------------------------Untouched Windows------------------------`n`n%UntouchedWin%`n`n`n`n------------------------Touched Windows------------------------`n`n%MinWin%
   Return
;-----------------------------
   Show:
   WinGet, id, list,,,
   Loop, %id%
   {   
      this_id := id%A_Index%
      WinGetClass, this_class, ahk_id %this_id%
      WinGetTitle, this_title, ahk_id %this_id%
      IfInString, MinWin, %this_class% %this_title%
      {
         WinRestore, %this_title%
      }
   }
   Return
;-----------------------------
   GuiClose:
   GuiEscape:
   ExitApp




Last edited by madufo on May 7th, 2009, 10:32 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 7th, 2009, 9:47 pm 
Offline

Joined: May 7th, 2009, 9:03 pm
Posts: 13
By hiding, do you mean minimizing?

You can try first executing Windows+D to minimize all windows and then activating MyWindows so it's back up?

Just an idea :!:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 7th, 2009, 9:58 pm 
Offline

Joined: December 24th, 2008, 3:25 am
Posts: 1401
Location: :noitacoL
34t wrote:
By hiding, do you mean minimizing?

You can try first executing Windows+D to minimize all windows and then activating MyWindows so it's back up?

Just an idea :!:


:x you beat me by 10 seconds


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 7th, 2009, 10:01 pm 
Offline

Joined: April 8th, 2009, 8:23 pm
Posts: 3036
Location: Rio de Janeiro - RJ - Brasil
EDIT: nevermind, I stated something stupid :?


Last edited by MasterFocus on May 7th, 2009, 10:07 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 7th, 2009, 10:05 pm 
Offline

Joined: March 24th, 2004, 2:34 pm
Posts: 299
There is a command called WinMinimizeAll. Does that help you?

There is also a command called WinHide.

Maybe that is what you have in mind?

WinHide WinMinimizeAll


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 7th, 2009, 10:44 pm 
Offline

Joined: December 22nd, 2008, 9:02 am
Posts: 9
34t wrote:
By hiding, do you mean minimizing?


Yes I do. That is the reason why I edited the subject. Sorry for this.

34t wrote:
You can try first executing Windows+D to minimize all windows and then activating MyWindows so it's back up?


I was thinking about this. But I don't want to flicker (minimize/restore) the MyWindow while it provides the main gui.

JDN wrote:
There is a command called WinMinimizeAll. Does that help you?
There is also a command called WinHide.


Your first suggestion is what I don't want to do. See above please.
Your second suggestion is what I realized with the WinMinimize command.
But I can not prevent the MyWindow from being minimized.

Thank you so far.

Any other suggestions?ยด

madufo


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 7th, 2009, 11:57 pm 
Offline

Joined: March 24th, 2004, 2:34 pm
Posts: 299
I found a terrific section of code that may be of help to you.

I had been wondering lately how I could find all Windows on my desktop. I think that may be the solution to your problem.

Perhaps you need to visit each window in turn and minimize them all except for your window.

To do this, see the documentation for the WinGet command. There is a snippet there which demonstrates how to visit all windows on the desktop.

WinGet

Here it is:

Code:
; Example #2: This will visit all windows on the entire system and display info about each of them:
WinGet, id, list,,, Program Manager
Loop, %id%
{
    this_id := id%A_Index%
    WinActivate, ahk_id %this_id%
    WinGetClass, this_class, ahk_id %this_id%
    WinGetTitle, this_title, ahk_id %this_id%
    MsgBox, 4, , Visiting All Windows`n%a_index% of %id%`nahk_id %this_id%`nahk_class %this_class%`n%this_title%`n`nContinue?
    IfMsgBox, NO, break
}


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: dmg, krajan, over21, RaptorX, Yahoo [Bot] and 63 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:
cron
Powered by phpBB® Forum Software © phpBB Group