Jump to content

GUI @SW_HIDE without visual effects - how?


orbs
 Share

Go to solution Solved by Yashied,

Recommended Posts

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?

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Link to comment
Share on other sites

 

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

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

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

:)

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

tried that. disabling before hiding makes no difference.

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

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

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

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

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

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

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

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