 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
ulti
Joined: 08 Dec 2009 Posts: 18
|
Posted: Sun Dec 20, 2009 11:28 pm Post subject: Windows on top of eachother: Z coord? |
|
|
If you take all the windows that exist on your screen, you could say they all have a Z-coordinate ( dimension of depth).
Is there a way to specify the Z-coord of a certain window?
An example of my case:
I have 5 windows stacked on eachother and when the visible window contains a certain pixel, it will be moved away from the stack to the right.
Then i do an action on the window and it should be moved back to the stack on the left, but to the very back of this stack.
However, when i just use WinMove, it will move the window to the front of the stack ( since it's also activated ).
So is there a way to move it to the back of the stack? |
|
| Back to top |
|
 |
Micahs
Joined: 01 Dec 2006 Posts: 460
|
Posted: Mon Dec 21, 2009 12:16 am Post subject: |
|
|
You could use the 'SetWindowPos' API call. You can't specify a position, but you provide an hwnd to insert after. _________________
 |
|
| Back to top |
|
 |
Guest
|
|
| Back to top |
|
 |
Micahs
Joined: 01 Dec 2006 Posts: 460
|
Posted: Mon Dec 21, 2009 12:59 am Post subject: |
|
|
This will place the gui behind the active window when you press Esc. (Obviously, our gui can't be the active one or it won't do anything!)
| Code: | SWP_NOMOVE=0x2 ;These are flags for 'setWindowPos' use these as necessary
SWP_NOSIZE=0x1
SWP_NOACTIVATE=0x10
SWP_SHOWWINDOW=0x40
SWP_NOZORDER=0x4
SWP_FRAMECHANGED=0x20
Gui, +LastFound
Gui, Add, Text,, Press 'Esc' to place this window behind the active window
Gui, Show, NA
guiID := WinExist()
Return
Esc::
aID := WinExist("A") ;get the id of the active window
gx := 0 ;we are using 'SWP_NOMOVE' and 'SWP_NOSIZE' so the size and pos can be null.
gy := 0
gw := 0
gh := 0
ret1 := DllCall("SetWindowPos", "UInt", guiID, "UInt", aID, "Int", gx, "Int", gy, "Int", gw, "Int", gh, "UInt", SWP_NOACTIVATE|SWP_SHOWWINDOW|SWP_FRAMECHANGED|SWP_NOMOVE|SWP_NOSIZE)
Return |
_________________
 |
|
| Back to top |
|
 |
ulti
Joined: 08 Dec 2009 Posts: 18
|
Posted: Wed Dec 23, 2009 12:11 pm Post subject: |
|
|
| Thanks for the help guys. |
|
| 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
|