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