Jump to content

SystemParametersInfo result


MyEarth
 Share

Recommended Posts

Hi, the _GetMinAnimate not work like expected, someone knows why?  Orginal code by eemuli

_SetMinAnimate(False)
MsgBox(0, 0, _GetMinAnimate())

Sleep(2000)

_SetMinAnimate(True)
MsgBox(0, 0, _GetMinAnimate())

Func _SetMinAnimate($bBoolean = True) ; $SPI_SETANIMATION = 0x0049
    Local Const $tagANIMATIONINFO = "uint cbSize;int iMinAnimate"
    Local $sStruct = DllStructCreate($tagANIMATIONINFO)
    DllStructSetData($sStruct, "iMinAnimate", $bBoolean)
    DllStructSetData($sStruct, "cbSize", DllStructGetSize($sStruct))
    $aReturn = DllCall('user32.dll', 'int', 'SystemParametersInfo', 'uint', 0x0049, 'int', DllStructGetSize($sStruct), 'ptr', DllStructGetPtr($sStruct), 'uint', 0)
    If IsArray($aReturn) Then Return 1
    Return 0
EndFunc   ;==>_SetMinAnimate



Func _GetMinAnimate() ; $SPI_GETANIMATION = 0x0048
    Local Const $tagANIMATIONINFO = "uint cbSize;int iMinAnimate"
    Local $sStruct = DllStructCreate($tagANIMATIONINFO)
    DllStructSetData($sStruct, "cbSize", DllStructGetSize($sStruct))
    $aReturn = DllCall('user32.dll', 'int', 'SystemParametersInfo', 'uint', 0x0048, 'int', DllStructGetSize($sStruct), 'ptr', DllStructGetPtr($sStruct), 'uint', 0)
    If IsArray($aReturn) Then Return $aReturn[0]
    Return 0
EndFunc   ;==>_GetMinAnimate

Thanks

Link to comment
Share on other sites

It's working for me. if You mean (windows got a nice effect while activate/deactive)

 

Saludos

Edited by Danyfirex
Link to comment
Share on other sites

No, you don't have understand :D

_SetMinAnimate with be different boolean value work fine and until that is ok, is _GetMinAnimate in the MsgBox don't give me the correct boolean value:

GETANIMATION
Retrieves the animation effects associated with user actions. The pvParam parameter must point to an ANIMATIONINFO structure that receives the information. Set the cbSize member of this structure and the uiParam parameter to sizeof(ANIMATIONINFO).

I want to know if is activate/deactive before activating/deactivating

 

Link to comment
Share on other sites

mmm I see now. Just return the iMinAnimate 

 

_SetMinAnimate(False)
MsgBox(0, 0,  (_GetMinAnimate() ? "Active" : "Deactive"))

Sleep(2000)

_SetMinAnimate(True)
MsgBox(0, 0, (_GetMinAnimate() ? "Active" : "Deactive"))

Func _SetMinAnimate($bBoolean = True) ; $SPI_SETANIMATION = 0x0049
    Local Const $tagANIMATIONINFO = "uint cbSize;int iMinAnimate"
    Local $sStruct = DllStructCreate($tagANIMATIONINFO)
    DllStructSetData($sStruct, "iMinAnimate", $bBoolean)
    DllStructSetData($sStruct, "cbSize", DllStructGetSize($sStruct))
    $aReturn = DllCall('user32.dll', 'int', 'SystemParametersInfo', 'uint', 0x0049, 'int', DllStructGetSize($sStruct), 'ptr', DllStructGetPtr($sStruct), 'uint', 0)
    If IsArray($aReturn) Then Return 1
    Return 0
EndFunc   ;==>_SetMinAnimate



Func _GetMinAnimate() ; $SPI_GETANIMATION = 0x0048
    Local Const $tagANIMATIONINFO = "uint cbSize;int iMinAnimate"
    Local $sStruct = DllStructCreate($tagANIMATIONINFO)
    DllStructSetData($sStruct, "cbSize", DllStructGetSize($sStruct))
    $aReturn = DllCall('user32.dll', 'int', 'SystemParametersInfo', 'uint', 0x0048, 'int', DllStructGetSize($sStruct), 'ptr', DllStructGetPtr($sStruct), 'uint', 0)
    If IsArray($aReturn) Then Return $sStruct.iMinAnimate
    Return 0
EndFunc   ;==>_GetMinAnimate

Saludos

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