Jump to content

to exit animated swirling guı


Recommended Posts

like this animated guı exit

SpiralBitmap

exam star guı

#Include <GUIConstantsEx.au3>
#Include <WinAPI.au3>
#Include <WindowsConstants.au3>
Global $aPoint[10][2] = [[0, 180], [190, 180], [250, 0], [308, 180], [500, 180], [344, 294], [404, 475], [250, 362], [94, 475], [154, 294]]
$hForm = GUICreate('MyGUI', 500, 475, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
$Button = GUICtrlCreateButton('Exit', 215, 255, 70, 23)
GUIRegisterMsg($WM_NCHITTEST, 'WM_NCHITTEST')
GUISetBkColor(0xAA0000)
$hRgn = _WinAPI_CreatePolygonRgn($aPoint)
_WinAPI_SetWindowRgn($hForm, $hRgn)
GUISetState()
Do
Until GUIGetMsg() = $Button
Func _WinAPI_CreatePolygonRgn($aPoint, $iStart = 0, $iEnd = -1, $iMode = 1)
    If UBound($aPoint, 2) < 2  Then
        Return SetError(1, 0, 0)
    EndIf
    Local $Count, $tData, $Struct = ''
    If ($iEnd < 0) Or ($iEnd > UBound($aPoint) - 1) Then
        $iEnd = UBound($aPoint) - 1
    EndIf
    For $i = $iStart To $iEnd
        $Struct &= 'int[2];'
    Next
    $tData = DllStructCreate(StringTrimRight($Struct, 1))
    If @error Then
        Return SetError(1, 0, 0)
    EndIf
    $Count = 1
    For $i = $iStart To $iEnd
        For $j = 0 To 1
            DllStructSetData($tData, $Count, $aPoint[$i][$j], $j + 1)
        Next
        $Count += 1
    Next
    Local $Ret = DllCall('gdi32.dll', 'ptr', 'CreatePolygonRgn', 'ptr', DllStructGetPtr($tData), 'int', $Count - 1, 'int', $iMode)
    If (@error) Or ($Ret[0] = 0) Then
        Return SetError(1, 0, 0)
    EndIf
    Return $Ret[0]
EndFunc   ;==>_WinAPI_CreatePolygonRgn
Func WM_NCHITTEST($hWnd, $Msg, $wParam, $lParam)
    If _WinAPI_DefWindowProc($hWnd, $Msg, $wParam, $lParam) = $HTCLIENT Then
        Return $HTCAPTION
    EndIf
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NCHITTEST

ı want to make spiral guı,but animated spiral guı ,to exit

#Include <GUIConstantsEx.au3>
#Include <WinAPI.au3>
#Include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("[#] Form1 [#]", 623, 442, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
$Button = GUICtrlCreateButton('Exit', 215, 255, 70, 23)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_animated_spiral_exit ($Form1)
;ı want to make spiral guı,but animated spiral guı ,to exit

Exit
EndSwitch
WEnd

func _animated_spiral_exit ($guı)

$hRgn = _WinAPI_CreatePolygonRgn($aPoint)
_WinAPI_SetWindowRgn($hForm, $hRgn)

end func

thank you now

Edited by mesale0077
Link to comment
Share on other sites

i don't know exactly what you want.

if i get it right you just have to put the source of the spiraling gui in a func and call it right before you exit the programm.

like

Func _exit()
spiralingGUI()
exit
EndFunc

and by the way your first source have errors.

when i paste your source as it is i get an error in line 23 ($Struct &amp;amp;amp;= 'int[2];')

and i really dont know what this line should do.

Edited by airrs
Link to comment
Share on other sites

look

#Include <GUIConstantsEx.au3>
#Include <WinAPI.au3>
#Include <WindowsConstants.au3>
Global $aPoint[10][2] = [[0, 180], [190, 180], [250, 0], [308, 180], [500, 180], [344, 294], [404, 475], [250, 362], [94, 475], [154, 294]]
$hForm = GUICreate('MyGUI', 500, 475, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
$Button = GUICtrlCreateButton('Exit', 215, 255, 70, 23)
GUIRegisterMsg($WM_NCHITTEST, 'WM_NCHITTEST')
GUISetBkColor(0xAA0000)
$hRgn = _WinAPI_CreatePolygonRgn($aPoint)
_WinAPI_SetWindowRgn($hForm, $hRgn)
GUISetState()
Do
Until GUIGetMsg() = $Button
Func _WinAPI_CreatePolygonRgn($aPoint, $iStart = 0, $iEnd = -1, $iMode = 1)
If UBound($aPoint, 2) < 2 Then
     Return SetError(1, 0, 0)
EndIf
Local $Count, $tData, $Struct = ''
If ($iEnd < 0) Or ($iEnd > UBound($aPoint) - 1) Then
     $iEnd = UBound($aPoint) - 1
EndIf
For $i = $iStart To $iEnd
     $Struct &= 'int[2];'
Next
$tData = DllStructCreate(StringTrimRight($Struct, 1))
If @error Then
     Return SetError(1, 0, 0)
EndIf
$Count = 1
For $i = $iStart To $iEnd
     For $j = 0 To 1
         DllStructSetData($tData, $Count, $aPoint[$i][$j], $j + 1)
     Next
     $Count += 1
Next
Local $Ret = DllCall('gdi32.dll', 'ptr', 'CreatePolygonRgn', 'ptr', DllStructGetPtr($tData), 'int', $Count - 1, 'int', $iMode)
If (@error) Or ($Ret[0] = 0) Then
     Return SetError(1, 0, 0)
EndIf
Return $Ret[0]
EndFunc ;==>_WinAPI_CreatePolygonRgn
Func WM_NCHITTEST($hWnd, $Msg, $wParam, $lParam)
If _WinAPI_DefWindowProc($hWnd, $Msg, $wParam, $lParam) = $HTCLIENT Then
     Return $HTCAPTION
EndIf
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NCHITTEST
Edited by mesale0077
Link to comment
Share on other sites

so you want the red star to swirl out after clicking exit?

p.s. can't you just put your request in normal sentences, so i don't have to ask anytime?

p.p.s. put your autoit source betweeen "[auto]" and "[/auto]"

Edited by airrs
Link to comment
Share on other sites

  • 5 months later...

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