Jump to content

GUI @SW_HIDE without visual effects - how?


Go to solution Solved by Yashied,

Recommended Posts

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 ;)

:)

EasyCodeIt - A cross-platform AutoIt implementation

DcodingTheWeb Forum - Follow for updates and Join for discussion

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.

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

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.

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"

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.

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

Link to post
Share on other sites

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
Link to post
Share on other sites
  • Solution

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

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

Sleep(1000)

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...