Page 1 of 1
Send Window to Back Action
Posted: Sun Feb 14, 2010 7:05 am
by PooFox
We've got "Send Window to Front", we need "Send Window to Back", because different windows respond differently to Close Window and Minimize Window. "Send to Back" will just get it outta my face! Used in conjunction with the escape key, as i would like to, this provides a more interactive and useful (imo) alt+tab type function.
This would be quite handy, thanks.
Re: Send Window to Back Action
Posted: Sun Feb 14, 2010 10:24 am
by Pako
You can try this script:
Code: Select all
#Script "Send Window to Back"
HWND_BOTTOM = 0x0001
SWP_NOSIZE = 0x0001
SWP_NOMOVE = 0x0002
SWP_NOACTIVATE = 0x0010
SWP_SHOWWINDOW = 0x0040
SWP_HIDEWINDOW = 0x0080
SWP_ASYNCWINDOWPOS = 0x4000
FLAGS_1 = SWP_ASYNCWINDOWPOS | SWP_NOSIZE | SWP_NOMOVE | SWP_HIDEWINDOW | SWP_NOACTIVATE
FLAGS_2 = SWP_ASYNCWINDOWPOS | SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW | SWP_NOACTIVATE
if eg.result and len(eg.result) > 0:
hwnd = eg.result[0]
from ctypes import windll
SetWindowPos = windll.user32.SetWindowPos
SetWindowPos(hwnd, HWND_BOTTOM, 0, 0, 0, 0, FLAGS_1)
SetWindowPos(hwnd, HWND_BOTTOM, 0, 0, 0, 0, FLAGS_2)
Pako
Re: Send Window to Back Action
Posted: Sun Feb 14, 2010 11:14 pm
by PooFox
hmm, this script doesnt seem to be doing anything. eventghost verifies that its being launched by my escape key but nothing happens. i did install python as well, but that didnt change anything. thanks though...
Re: Send Window to Back Action
Posted: Mon Feb 15, 2010 7:27 am
by Pako
My English is very weak and I might not understand correctly your request.
I am convinced that my script does exactly what you requested.
I please - can anyone try?
What is really a problem?
Pako
Re: Send Window to Back Action
Posted: Mon Feb 15, 2010 7:35 am
by jinxdone
Pako's script is working great. You just have to use the find window macro first to target something just before the python script, maybe you missed that PooFox?
As an alternative there is a default feature in Windows, alt-esc, that sends the current focused window to the background. shift-alt-esc does the opposite, it brings the lowest z-index window to the front.
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1397">
<Macro Name="Emulate Keystrokes: {Alt+Escape}" Expanded="True">
<Action>
Window.SendKeys(u'{Alt+Escape}', False)
</Action>
</Macro>
</EventGhost>
-jinxdone
Re: Send Window to Back Action
Posted: Tue Feb 16, 2010 12:07 am
by PooFox
yea ive got it setup right with escape, find frontmost window, and the python script (which i copied and pasted from the post) actions under the macro . It doesnt do anything when i hit escape however...
Alt+Esc will work for now.
Re: Send Window to Back Action
Posted: Tue Feb 16, 2010 6:17 am
by Pako
Which way you have done the bind between pressing the Escape key and run the macro?
Pako