orbs

GUI @SW_HIDE without visual effects - how?

14 posts in this topic

whenever i call this on my GUI:

GUISetState(@SW_HIDE)

the GUI does indeed become hidden, but it does so with a visual effect used for the Minimize command - i.e. decreasing size while fading. the effect is very swift, but still i'd like to cancel this effect and make the GUI immediately hidden.

any hints?

1 person likes this

Share this post


Link to post
Share on other sites




AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

 

nope. it doesn't work in practice, and no reason it should work in theory either.

Share this post


Link to post
Share on other sites

Func _WinHide($hWin, $toggled = False)
    If $toggled = False Then
        GUISetState(@SW_DISABLE, $hWin)
        GUISetState(@SW_HIDE, $hWin)
    Else
        GUISetState(@SW_ENABLE, $hWin)
        GUISetState(@SW_SHOW, $hWin)
    EndIf
EndFunc ; TheDcoder ;)

:)


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

tried that. disabling before hiding makes no difference.

Share this post


Link to post
Share on other sites

tried that. disabling before hiding makes no difference.

Strange.... Works for me


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

I can't say I've ever noticed this issue.

Perhaps it is a Windows setting on your PC?

I seem to recall you can have that occur.

I don't have that enabled on mine.

1 person likes this

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

Strange.... Works for me

 

if you omit the disable/enable, do you see the effect that you claim not to see when the disable/enable in place?

 

Perhaps it is a Windows setting on your PC?

 

it is, it's part of the Aero effects. the point is - i don't want it disabled, not in general and not for this application. i simply want this specific GUI of my script to just hide itself when i ask it to.

Share this post


Link to post
Share on other sites

if you omit the disable/enable, do you see the effect that you claim not to see when the disable/enable in place?

no


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

no

 

so if either way you do not see the effect, it means disable/enable does not make any difference. b.t.w it is set here::

System Properties > Advanced > Performance > Settings...

Visual Effects > "Animate windows when minimizing and maximizing"

Share this post


Link to post
Share on other sites
System Properties > Advanced > Performance > Settings...

Visual Effects > "Animate windows when minimizing and maximizing"

So if you change that setting, do you still get your issue?

If no, then you need to look at something that will either temporarily unset that setting, or you need to do research outside of AutoIt I expect, for it would be a Windows issue, not an AutoIt one. That's not to say that some DLL call etc might not do the trick.


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Try this:

Func EnableWindowAnimation($value = True)

Local Const $SPI_SETANIMATION = 0x0049
Local Const $SPI_GETANIMATION = 0x0048
Local Const $tagANIMATIONINFO = "uint cbSize;int iMinAnimate"

Local $struct = DllStructCreate($tagANIMATIONINFO)
DllStructSetData($struct, "iMinAnimate", $value)
DllStructSetData($struct, "cbSize", DllStructGetSize($struct))

$aReturn = DllCall('user32.dll', 'int', 'SystemParametersInfo', 'uint', $SPI_SETANIMATION, 'int', DllStructGetSize($struct), _
   'ptr', DllStructGetPtr($struct), 'uint', 0)

EndFunc   ;==>_wndMinAnimation

Call that function with a False argument and then do the GUISetState(@SW_HIDE) . Just dont forget to enable the animation back by calling the Function with the True argument. 

Best bet is to put it on gui close event:

Case $GUI_EVENT_CLOSE
                    EnableWindowAnimation(True)

Though to be honest I've never experienced this issue might be some funky windows settings on your machine....

Edited by mpower

Share this post


Link to post
Share on other sites

$hForm = GUICreate('MyGUI', 400, 400)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case -3
            WinSetTrans($hForm, '', 0)
            GUISetState(@SW_HIDE)
            ExitLoop
    EndSwitch
WEnd

Sleep(1000)

Share this post


Link to post
Share on other sites
WinSetTrans($hForm, '', 0)

 

someday i'll make it to the level i'll feel ashamed for not thinking about it myself... a simple and elegant workaround! thanks Yashid!  :thumbsup:

1 person likes this

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