Jump to content

Show GUI *behind* existing windows [SOLVED]


mlowery
 Share

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.

SOLUTION

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))
Sleep(5000)
Exit
Edited by mlowery
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...