![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Does anyone know if AnimateWindow (user32.dll) can be used in conjunction with custom controls for example, to fade controls in and out when their visibility is changed? I've tried to call AnimateWindow in Control_Load, OnVisibleChanged and also when the WM_SHOWWINDOW message is sent, but nothing happens. |
#3
| |||
| |||
|
|
MariusI wrote: Does anyone know if AnimateWindow (user32.dll) can be used in conjunction with custom controls for example, to fade controls in and out when their visibility is changed? I've tried to call AnimateWindow in Control_Load, OnVisibleChanged and also when the WM_SHOWWINDOW message is sent, but nothing happens. I've only ever tried it with Forms, not with single controls. The API docs (http://shrinkster.com/7wy) don't say anything about this, but have you tried checking the return code of the AnimateWindow function? At least you'll find out if the function itself thinks there's something wrong. Oliver Sturm -- Expert programming and consulting services available See http://www.sturmnet.org (try /blog as well) |
#4
| |||
| |||
|
|
Well, the return value indicates that something is wrong, but in terms of documentation and usage, i can't see any reason as to why this shouldn't work. The documentation states that the AnimateWindow function should recieve a window handle. Since a control is a technically a window this should work fine, but it doesn't so i'm obviously missing something here :-). |
|
By the way, my problems with flickering child controls when resizing was solved by removing the client area from the nc-area graphics object before it was drawn. The underlying bitmap had transparency set in the client area, but that wasn't enough to avoid the flicker. |
#5
| |||
| |||
|
|
MariusI wrote: Well, the return value indicates that something is wrong, but in terms of documentation and usage, i can't see any reason as to why this shouldn't work. The documentation states that the AnimateWindow function should recieve a window handle. Since a control is a technically a window this should work fine, but it doesn't so i'm obviously missing something here :-). Have you used GetLastError? What does it say? By the way, my problems with flickering child controls when resizing was solved by removing the client area from the nc-area graphics object before it was drawn. The underlying bitmap had transparency set in the client area, but that wasn't enough to avoid the flicker. Ah - nice to hear you figured it out. Oliver Sturm -- Expert programming and consulting services available See http://www.sturmnet.org (try /blog as well) |
#6
| |||
| |||
|
|
Well, guess this doesn't work, i got the "ERROR_INVALID_WINDOW_HANDLE". Any microsoft officials who would like to comment on the error? "Oliver Sturm" wrote: MariusI wrote: Well, the return value indicates that something is wrong, but in terms of documentation and usage, i can't see any reason as to why this shouldn't work. The documentation states that the AnimateWindow function should recieve a window handle. Since a control is a technically a window this should work fine, but it doesn't so i'm obviously missing something here :-). Have you used GetLastError? What does it say? By the way, my problems with flickering child controls when resizing was solved by removing the client area from the nc-area graphics object before it was drawn. The underlying bitmap had transparency set in the client area, but that wasn't enough to avoid the flicker. Ah - nice to hear you figured it out. Oliver Sturm -- Expert programming and consulting services available See http://www.sturmnet.org (try /blog as well) |
#7
| |||
| |||
|
|
Well, I'm not an official MS source, but given that the docs for "AnimateWindow" say that the function will fail "[w]hen trying to animate a child window with AW_BLEND", this may be the source of your problem. MSDN says that AW_BLEND can only be used on a top-level window, and your custom control is not likely that. HTH - Scott |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |