Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear All,
I use below code to get the ForegroundWindow (selected window)
and make it has fade out effect
CWnd *hwnd=GetForegroundWindow();
hwnd->AnimateWindow(1000,AW_HIDE|AW_BLEND); 


but It only apply to the dialog I created.
other windows like IE, caculator.exe or even the other dialog made by myself woundn't have this effect?

What's going wrong with that?

Thanks all
Posted
Comments
Sergey Alexandrovich Kryukov 20-Feb-14 2:34am    
Here is my good advice: those are not the applications you developed, so they are not yours, don't touch them.
Do you really have nothing more useful to do?
—SA
enhzflep 20-Feb-14 3:04am    
Did you read the documentation?

Specifically, the last point in this list:

If the function fails, the return value is zero. The function will fail in the following situations:

■ If the window uses the window region. Windows XP: This does not cause the function to fail.
■ If the window is already visible and you are trying to show the window.
■ If the window is already hidden and you are trying to hide the window.
■ If there is no direction specified for the slide or roll animation.
■ When trying to animate a child window with AW_BLEND.
■ If the thread does not own the window. Note that, in this case, AnimateWindow fails but GetLastError returns ERROR_SUCCESS.
Malli_S 21-Feb-14 8:53am    
My 5.
enhzflep 21-Feb-14 9:39am    
Thank-you. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900