Shit's dead as fuck :\
Fasm snippet to fade a window in, called either in WM_CREATE or after window creation:
Code:
fade_time = 1000
; start fading
invoke GetWindowLong,[hWnd],GWL_EXSTYLE
or eax, WS_EX_LAYERED
invoke SetWindowLong,[hWnd],GWL_EXSTYLE,eax
invoke GetTickCount
mov ebx, eax
.sfade:
invoke GetTickCount
sub eax, ebx
cmp eax, fade_time
jge .efade
shl eax, 8
cdq
mov ecx, fade_time
div ecx
invoke SetLayeredWindowAttributes,[hWnd],0,eax,LWA_ALPHA
; check for window messages so it can still be controlled while we fade
@@:
xor eax, eax
invoke PeekMessage,msg,eax,eax,eax,PM_REMOVE
test eax, eax
jz @f
invoke TranslateMessage, msg
invoke DispatchMessage, msg
jmp @b
@@:
invoke Sleep, 10
jmp .sfade
.efade:
invoke GetWindowLong,[hWnd],GWL_EXSTYLE
mov edx, WS_EX_LAYERED
not edx
and eax, edx
invoke SetWindowLong,[hWnd],GWL_EXSTYLE,eax
; end fading
and for fading the window out just put "xor eax, 00FFh" after the div ecx.