AutoHotkey Community

It is currently May 27th, 2012, 12:42 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: December 21st, 2009, 12:28 am 
Offline

Joined: December 8th, 2009, 10:31 pm
Posts: 18
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2009, 1:16 am 
Offline

Joined: December 1st, 2006, 9:27 am
Posts: 460
You could use the 'SetWindowPos' API call. You can't specify a position, but you provide an hwnd to insert after.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2009, 1:55 am 
This thread might help as well - Changing a window's Z position (not top or bottom)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 21st, 2009, 1:59 am 
Offline

Joined: December 1st, 2006, 9:27 am
Posts: 460
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

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 23rd, 2009, 1:11 pm 
Offline

Joined: December 8th, 2009, 10:31 pm
Posts: 18
Thanks for the help guys.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Leef_me, Ohnitiel, XstatyK, Yahoo [Bot] and 14 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