 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
andrei901
Joined: 20 Jan 2008 Posts: 27
|
Posted: Mon Sep 01, 2008 4:00 am Post subject: WinHide/WinShow commands. |
|
|
I'm trying to write a script that will hide the last open window at the press of a hotkey, and then open it at the press of a different hotkey.
| Code: |
^!a::
WinHide
^!b::
WinShow
Exit
|
this should work, shouldn't it?
but for some reason it doesn't.
could someone please help? _________________ -andrei901, your local wannabe AHK expert |
|
| Back to top |
|
 |
Serenity
Joined: 07 Nov 2004 Posts: 1276
|
Posted: Mon Sep 01, 2008 9:37 am Post subject: |
|
|
By last open window do you mean previous window, or active window?
This will hide the previous window:
| Code: | ![:: ; hide
hwnd := WinActive("A")
; comment out this loop if you want to hide/show the active window
Loop
{
hwnd := DllCall( "GetWindow",uint,hwnd,int,3 ) ; 3 = GW_HWNDPREV
SetFormat,integer,hex
hwnd += 0
SetFormat,integer,d
if (DllCall("IsWindowVisible",uint,hwnd) = 1)
break
}
WinHide, ahk_id %hwnd%
return
!]:: ; show
WinShow, ahk_id %hwnd%
return |
_________________ "Anything worth doing is worth doing slowly." - Mae West
 |
|
| Back to top |
|
 |
andrei901
Joined: 20 Jan 2008 Posts: 27
|
Posted: Thu Sep 11, 2008 2:11 am Post subject: |
|
|
sorry, wasn't able to go to the forums for a while, but yes, thank you very much. _________________ -andrei901, your local wannabe AHK expert |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|