News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Notification for showing dialog?

Started by Ehtyar, August 20, 2006, 09:04:34 AM

Previous topic - Next topic

Ehtyar

Hi all.
I'm creating a dialog with DialogBoxParam, and i wish to make it fade in. I'm looping through SetLayeredWindowAttribute to increase the opacity (can't use AnimateWindow as the dialog is meant to be slightly transparent when the loop ends), but i'm having a problem. I'm calling the routine from the WM_INITDIALOG notification, but unfortunately none of the controls on my dialog are drawn at the time when WM_INITDIALOG is recieved. It is a custom dialog. Out of all the notifications i am monitoring, WM_PAINT seems to be the last one called prior to the dialog being fully drawn, but calling the fade in proc at WM_PAINT is not practical. I'm hoping someone has an idea on what notification i could use to call the fade in proc, so that all the controls are drawn prior to recieving the notification. Any help is appreciated, thank you.

Ehtyar


Ehtyar

Oh Phoenix thanks sooooo much, i tried a trick with RedrawWindow earlier but with different args, excellent link, thanks again :D

Ehtyar

Mark Jones

I had to try this, thanks Phoenix! Attached is a version which uses a timer to fade based on duration instead of interval.

[attachment deleted by admin]
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Phoenix

Glad it helped....

Mark, this is an excellent example! IMO, you should ensure that the maximum opaque value is exactly the required one? I did not test the value of eax (dwTransparency) in FadeIn/FadeOut, but it seems that the calculated value in eax can exceed the desired one...