Jump to content

Change OnTop state of GUI temporary to oher state


Buffo
 Share

Recommended Posts

Hi!

I have a gui which is created with parameter $WS_EX_TOPMOST.

There is a button which calls the FileOpenDialog. If this window is displayed the GUI should temporary set to background until the dialog is closed. How to realize that?

Thx in advance.

Regards,

Buffo

Link to comment
Share on other sites

This will not work. I searched the forum before but it seems that no one knows how to do it.

Opt("GuiOnEventMode", 1)
...
GuiCreate("bla bla bla", ... ,..., ...$WS_EX_TOPMOST)
$btn = GuiCtrlCreateButton("Click", ...)
GuiCtrlSetOnEvent($btn, "Click")
...

Func Click()
$var = FileOpenDialog(....)
...
EndFunc

It is not possible to set the FileopenFolder dialog with WinSetOnTop() because the script is paused there till the dialog ist closed.

Isn't there a possibility to change the window states after creating the window? I can't believe. ALL is possible with AutoIt3. Such a simple thing cannot be the limit :whistle:

Come on guys ;)

Regards,

Buffo

Link to comment
Share on other sites

Not sure why you would want to continue on with a dialog box like that waiting, but.....

if your creative enough you could do the same thing as was done with MsgBox

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Ahem... I just showed you the answer. I will reiterate with your own code:

Opt("GuiOnEventMode", 1)
...
$guihandle = GuiCreate("bla bla bla", ... ,..., ...$WS_EX_TOPMOST)
$btn = GuiCtrlCreateButton("Click", ...)
GuiCtrlSetOnEvent($btn, "Click")
...

Func Click()
WinSetOnTop($guihandle, "", 0)
$var = FileOpenDialog(....)
WinSetOnTop($guihandle, "", 1)
...
EndFunc

Now that wasn't hard, was it?

Who else would I be?
Link to comment
Share on other sites

@this-is-me: In the manual I totally read over the third "flag" parameter. With WinSetOnTop() I associated only the "on top" feature not the opposite. Sorry for such a stupid question and thanks for your support :whistle:

@Mod: Please delete ;)

Regards,

Buffo

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