hakand Posted April 15, 2006 Share Posted April 15, 2006 Hello everyone,I really wonder how it is done fading in and fading out effects while closing the application window and displaying it.Does anyone know how to? I need the codes for Win98(especially) and XP systems. Thanks in advance. Link to comment
Guest Tundra Posted April 15, 2006 Share Posted April 15, 2006 This is from Goppit's Win32 Assembly for Crackers. It can be found at tutorials.accessroot.comIn order to get our keygen to fade in and out on opening and closing, we have 2 procedures called FadeIn and FadeOut. For these we will need 2 prototypes, an uninitialised DWORD variable "Transparency" and the following constants which we have to define as they are not already in the windows.inc file: LWA_ALPHA, LWA_COLORKEY, WS_EX_LAYERED and DELAY_VALUE.In order to use the transparency features of win2k or XP (ie not available on older versions of windows), we must use a layered window. This can significantly improve performance and visual effects for a window that has a complex shape, animates its shape, or wishes to use alpha blending effects. The system automatically composes and repaints layered windows and the windows of underlying applications. As a result, layered windows are rendered smoothly, without the flickering typical of complex window regions. In addition, layered windows can be partially translucent, that is, alpha-blended. In order to make a layered window, the window must be created with or set to have the WS_EX_LAYERED extended windows style. The FadeIn procedure looks like this:FadeIn proc hWnd:HWND invoke ShowWindow,hWnd,SW_SHOW mov Transparency,75@@: invoke SetLayeredWindowAttributes,hWnd,0,Transparency,LWA_ALPHA invoke Sleep,DELAY_VALUE add Transparency,5 cmp Transparency,255 jne @b ret FadeIn endpThe GetWindowLong API retrieves information about a window. The type of information is specified by the 2nd param - in our case GWL_EXSTYLE requests the extended windows style for the window and this is returned in eax. The next line adds in the value represented by WS_EX_LAYERED to eax. The 3rd line sets this value as the extended windows style for the window.The SetLayeredWindowAttributes API sets the opacity and transparency colour key of a layered window. In this case the final parameter specifies a transparency (alpha blend) setting, and the 2nd 0 specifies completely transparent. The following line displays the window in a non-activated format and the next line moves a value of 75 into our transparency variable.The next loop of instructions increments transparency by 5 and sets the window transparency with the new value each loop until transparency reaches 255 (maximum value = opaque). Sleep leaves a small delay between each loop so that the fade does not occur too quickly to see. When transparency = 255 the procedure returns.The FadeOut procedure looks much the same and operates in reverse:FadeOut proc hWnd:HWND mov Transparency,255@@: invoke SetLayeredWindowAttributes,hWnd,0,Transparency,LWA_ALPHA invoke Sleep,DELAY_VALUE sub Transparency,5 cmp Transparency,0 jne @b retFadeOut endp Link to comment
yamraaj Posted April 16, 2006 Share Posted April 16, 2006 Or you can use AnimateWindow api..It has some cool effects Link to comment
hakand Posted April 18, 2006 Author Share Posted April 18, 2006 Hi Tundra,Those codes for fading effects can run XP systems. Am i right?Do you have codes that will run on win98 systems.Thanks. Link to comment
Guest Tundra Posted April 18, 2006 Share Posted April 18, 2006 You can tryinvoke AnimateWindow,hWin,1000,AW_BLEND+AW_ACTIVATEto fade inandinvoke AnimateWindow,hWin,1000,AW_BLEND+AW_HIDEto fade outThis won't work too well with invisible buttons, and I'm not even sure if this will work with Win9X; I only have WinXP Link to comment
hakand Posted April 20, 2006 Author Share Posted April 20, 2006 Tundra I couldnt find AnimateWindow function in win32API.hlp file. So, I am afraid win98 doesnt support that function.Are there some other solutions for fading effects on win98?Thanks. Link to comment
Guest Tundra Posted April 20, 2006 Share Posted April 20, 2006 Sorry, I only know those two ways Link to comment
Ehtyar Posted June 14, 2006 Share Posted June 14, 2006 SetLayeredWindowAttributes is also not available in 98 or 95, just use the osversioninfo struct to check that the major version is above 5 before fading the window, if it's not, use standard window creation methods Link to comment
AK-47 Posted July 6, 2006 Share Posted July 6, 2006 Hi guyz Anybody Know if this can be donewith a dUP Patch for exp.I have made a dUP patch compiled itand if i can make some code injectionand make it fade in and out? Link to comment
pRONOMIx Posted January 27, 2008 Share Posted January 27, 2008 This is from Goppit's Win32 Assembly for Crackers. It can be found at tutorials.accessroot.comIn order to get our keygen to fade in and out on opening and closing, we have 2 procedures called FadeIn and FadeOut. For these we will need 2 prototypes, an uninitialised DWORD variable "Transparency" and the following constants which we have to define as they are not already in the windows.inc file: LWA_ALPHA, LWA_COLORKEY, WS_EX_LAYERED and DELAY_VALUE.In order to use the transparency features of win2k or XP (ie not available on older versions of windows), we must use a layered window. This can significantly improve performance and visual effects for a window that has a complex shape, animates its shape, or wishes to use alpha blending effects. The system automatically composes and repaints layered windows and the windows of underlying applications. As a result, layered windows are rendered smoothly, without the flickering typical of complex window regions. In addition, layered windows can be partially translucent, that is, alpha-blended. In order to make a layered window, the window must be created with or set to have the WS_EX_LAYERED extended windows style. The FadeIn procedure looks like this:FadeIn proc hWnd:HWND invoke ShowWindow,hWnd,SW_SHOW mov Transparency,75@@: invoke SetLayeredWindowAttributes,hWnd,0,Transparency,LWA_ALPHA invoke Sleep,DELAY_VALUE add Transparency,5 cmp Transparency,255 jne @b ret FadeIn endpThe GetWindowLong API retrieves information about a window. The type of information is specified by the 2nd param - in our case GWL_EXSTYLE requests the extended windows style for the window and this is returned in eax. The next line adds in the value represented by WS_EX_LAYERED to eax. The 3rd line sets this value as the extended windows style for the window.The SetLayeredWindowAttributes API sets the opacity and transparency colour key of a layered window. In this case the final parameter specifies a transparency (alpha blend) setting, and the 2nd 0 specifies completely transparent. The following line displays the window in a non-activated format and the next line moves a value of 75 into our transparency variable.The next loop of instructions increments transparency by 5 and sets the window transparency with the new value each loop until transparency reaches 255 (maximum value = opaque). Sleep leaves a small delay between each loop so that the fade does not occur too quickly to see. When transparency = 255 the procedure returns.The FadeOut procedure looks much the same and operates in reverse:FadeOut proc hWnd:HWND mov Transparency,255@@: invoke SetLayeredWindowAttributes,hWnd,0,Transparency,LWA_ALPHA invoke Sleep,DELAY_VALUE sub Transparency,5 cmp Transparency,0 jne @b retFadeOut endpThanks for the infos :cool: Link to comment
Totenkopf Posted January 27, 2008 Share Posted January 27, 2008 Depending on what language you are using, it is obviously different. But in vb.net you can very easily do it using:Me.Opacity = Double valueFor example, Me.Opacity = 0 makes the form 'invisible' and Me.Opacity = 1 makes the form 100% visible. Just make a loop to slowly increment the opacity when the app starts and to decrement when it closes. Simple. Link to comment
Angel-55 Posted January 27, 2008 Share Posted January 27, 2008 @AK-47 Yeah you can inject code.....add the API AnimateWindow to your Patch and inject the code to determinate where it the WM_INIDIALOG Message routine found you can use a used function in it ^^ or with a bit more experiense by yourself....... Link to comment
ChupaChu Posted January 29, 2008 Share Posted January 29, 2008 Just simple FadeIn/Out examples for Delphi:procedure FadeIn(FormName : TForm; tranz : byte);vari : Integer;beginFormName.AlphaBlend := True;FormName.AlphaBlendValue := 0;FormName.Show;for i := 1 to tranz do begin FormName.AlphaBlendValue := FormName.AlphaBlendValue + 1; application.ProcessMessages; end;end;procedure FadeOut(FormName : TForm);vari : Integer;beginfor i := FormName.AlphaBlendValue downto 0 do begin FormName.AlphaBlendValue := FormName.AlphaBlendValue - 1; application.ProcessMessages; end;end;BR, ChupaChu! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now