Jump to content

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


DW1
 Share

Recommended Posts

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?

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
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...