Jump to content
Sign in to follow this  

Show GUI *behind* existing windows [SOLVED]

Recommended Posts


I've got a small script that processes files and displays a status GUI for a couple of seconds when each file is complete. If I'm using the computer when this script gets called, these status windows -- displayed with GUISetState(@SW_SHOW) -- keep popping up on top of what I'm working on, stealing focus and covering up what I'm working on.

Is there a way to make these GUIs appear behind open/active windows? So that if I'm looking at the desktop with minimized or inactive windows I can see them, but they won't cover my current active window? Something like the opposite of $WS_EX_TOPMOST, I guess.


Digging around in the help file, I found _WinAPI_SetWindowPos, and found the combination of flags using the information on the MSDN site linked from the help. Works perfectly!

#Include <WinAPI.au3>
#include <Constants.au3>

$hwnd = GUICreate("title",200,100)
$pos = WinGetPos($hwnd)
_WinAPI_SetWindowPos($hwnd, $HWND_BOTTOM, $pos[0], $pos[1], $pos[2], $pos[3], BitOR($SWP_SHOWWINDOW, $SWP_NOACTIVATE))
Edited by mlowery

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.