Sign in to follow this  
Followers 0
Buffo

Change OnTop state of GUI temporary to oher state

7 posts in this topic

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

Share this post


Link to post
Share on other sites



$guihandle = GuiCreate("bla bla bla")
WinSetOnTop($guihandle, "", 0)


Who else would I be?

Share this post


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

Share this post


Link to post
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.

 

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

I missed the boat on that one, guess I totally mis-understood what was trying to be accomplished.


SciTE for AutoItDirections for Submitting Standard UDFs

 

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

 

Share this post


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

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