Sign in to follow this  
Followers 0
DW1

GUI Always on top.... but sometimes not?

7 posts in this topic

my gui starts like this

$parent = GUICreate("whatever", 287, 382, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS), $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST)

It stays on top.... usualy.

I have a program that pops up when an individual calls in via VOIP.

Whenever that program pops up to the top, it covers up my GUI.

How can I keep my GUI as the TOPMOST even in this case?

Share this post


Link to post
Share on other sites

If there are more "stay on top" windows then last one created/opened is ON TOP over others on top windows.

You must:

- remove always on top style from another windows (by some AdLib) or invoke BringToFont for your window

- or catch some global event when windows are created/ioened and do some BringToFont

Share this post


Link to post
Share on other sites

Awesome, thank you.

Does BringToFont focus the windows as well or just... well... do what it says "BringToFont"?

Thanks again for the speedy response.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I cannot seem to find anything in the help about BringToFont

what is BringToFont and how can I use it in my script?

The window covering up mine is NOT a stay ontop window.

It just seems to pop to the front. It doesn't stay infront, and if I click my GUI and then go back to the application that is covering it, my GUI is on top and everything works properly.

Edited by danwilli

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

The function your looking for WinSetOnTop($parent, "", 1)

Edited by smashly

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I think you should setup your window to "top of Z-order" --> $HWND_TOPMOST + $HWND_TOP

SetWindowPos($Form1, $HWND_TOPMOST + $HWND_TOP, 0, 0, 0, 0, BitOR($SWP_NOMOVE,$SWP_NOSIZE))

Func SetWindowPos($hwnd, $InsertHwnd, $X, $Y, $cX, $cY, $uFlags)
    $ret = DllCall("user32.dll", "long", "SetWindowPos", "hwnd", $hwnd, "hwnd", $InsertHwnd, _
                    "int", $X, "int", $Y, "int", $cX, "int", $cY, "long", $uFlags)
    Return $ret[0]
EndFunc

Look at MSDN for details

Edited by Zedna

Share this post


Link to post
Share on other sites

a HUGE thanks to both of you. Both examples will work correctly.

Problem solved

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  
Followers 0