click
here for more groovy stuff like this
func corz_GUIAnimateOpen(
$some_gui=
"",
$GUIFX=
"",
$ini_file=
"",
$ini_section=
"")
if not
$some_gui then
return corz_GUIGetFX(
$GUIFX,
$ini_file ,
$ini_section)
else
if not IsArray(
$GUIFX) then
$GUIFX = corz_ValidateFXCodes(
$GUIFX,
$ini_file,
$ini_section)
endif
switch
$GUIFX[1]
case
"-" GUISetState(@SW_SHOW,
$some_gui)
return
case
"fade" corz_GUIFadeIn(
$some_gui)
case else
DllCall(
"user32.dll",
"int",
"AnimateWindow",
"hwnd",
$some_gui,
"int", 200,
"long",
$GUIFX[1])
GUISetState(@SW_SHOW,
$some_gui)
endswitch
return
$GUIFX endif
endfunc
func corz_GUIAnimateClose(
$some_gui=
"",
$GUIFX=
"",
$ini_file=
"",
$ini_section=
"")
if not
$some_gui then
return corz_GUIGetFX(
$GUIFX,
$ini_file,
$ini_section)
else
if not IsArray(
$GUIFX) then
$GUIFX = corz_ValidateFXCodes(
$GUIFX,
$ini_file,
$ini_section)
endif
switch
$GUIFX[1]
case
"-" GUISetState(@SW_HIDE,
$some_gui)
return
case
"fade" GUISetState(@SW_SHOW,
$some_gui)
corz_GUIFadeOut(
$some_gui)
case else
GUISetState(@SW_SHOW,
$some_gui)
DllCall(
"user32.dll",
"int",
"AnimateWindow",
"hwnd",
$some_gui,
"int", 200,
"long",
$GUIFX[2])
GUISetState(@SW_HIDE,
$some_gui)
endswitch
return
$GUIFX endif
endfunc
func corz_GUIFadeIn(
$some_gui)
WinSetTrans(
$some_gui,
"", 0)
GUISetState(@SW_SHOW,
$some_gui)
for
$i = 0 to 240 step 15
WinSetTrans(
$some_gui,
"",
$i)
Sleep(5)
next
WinSetTrans(
$some_gui,
"", 255)
endfunc
func corz_GUIFadeOut(
$some_gui)
for
$i = 240 to 15 step - 15
Sleep(5)
WinSetTrans(
$some_gui,
"",
$i)
next
GUISetState(@SW_HIDE,
$some_gui)
endfunc
func corz_ValidateFXCodes(ByRef
$GUIFX,
$ini_file=
"",
$ini_section=
"")
if IsArray(
$GUIFX) then return
$GUIFX = corz_GUIGetFX(
$GUIFX,
$ini_file,
$ini_section)
return
$GUIFXendfunc
func corz_GUIGetFX(
$fx=
"",
$fx_ini_path=
"",
$fx_ini_section=
"corz gui fx",
$fx_win =
"gui_fx")
if
$fx_ini_path and
$fx =
"" then
$fx = IniRead(
$fx_ini_path,
$fx_ini_section,
$fx_win,
"Slide right")
endif
switch
$fx case
"-",
"Disabled",
"disable",
"Disable window animation" local
$GUIFX[3] = [2,
"disable",
"disable"]
case
"fade" local
$GUIFX[3] = [2,
"fade",
"fade"]
case
"Slide Left",
"Left",
"Slide L",
"l" local
$GUIFX[3] = [2, '0x00040001', '0x00050002']
case
"Slide Top",
"Slide T",
"Top",
"t" local
$GUIFX[3] = [2, '0x00040004', '0x00050008']
case
"Slide Right",
"Right",
"Slide R",
"Slide",
"r" local
$GUIFX[3] = [2, '0x00040002', '0x00050001']
case
"Slide Bottom",
"Slide B",
"Bottom",
"b" local
$GUIFX[3] = [2, '0x00040008', '0x00050004']
case
"Slide Top Left",
"Top Left",
"top-left",
"tl",
"diagonal tl",
"d" local
$GUIFX[3] = [2, '0x00040005', '0x0005000a']
case
"Slide Top Right",
"Top Right",
"top-right",
"tr",
"diagonal tr" local
$GUIFX[3] = [2, '0x00040006', '0x00050009']
case
"Slide Bottom Right",
"Bottom Right",
"bottom-right",
"br",
"diagonal br" local
$GUIFX[3] = [2, '0x0004000a', '0x00050005']
case
"Slide Bottom Left",
"Bottom Left",
"bottom-left",
"bl",
"diagonal bl" local
$GUIFX[3] = [2, '0x00040009', '0x00050006']
case
"x",
"Implode/Explode",
"Explode/Implode",
"Explode",
"Implode" local
$GUIFX[3] = [2, '0x00040010', '0x00050010']
case
"" continuecase
case else
$fx =
"Slide Right" local
$GUIFX[3] = [2, '0x00040002', '0x00050001']
endswitch
EnvSet(
$fx_win,
$fx)
if
$fx_ini_path then IniWrite(
$fx_ini_path,
$fx_ini_section,
$fx_win,
$fx)
return
$GUIFXendfunc