Weird form drop shadow flicker when playing movie

quantum1976
08-14-2009, 09:33 AM
I've written a small movie player (using winmm.dll and the MCI API) that is meant to run on Windows 2000. I want to give the form an "all-a-around" drop shadow similar to Windows 7 (also maybe in Vista, but I've never used it).

To create the drop shadow, I used vbAccelerator's Creating Drop-Shadows (http://www.vbaccelerator.com/home/VB/Code/Libraries/Graphics_and_GDI/Drop_Shadows/article.asp)

I modified this to add the drop shadow to all 4 sides and added a new formula to calculate a better drop off for the shadow rather than the uniform shadow that it currently draws.

All of this works fine and player looks great. The problem I'm having is that as soon as the movie starts playing, the 4 drop shadow windows flicker wildly, about 3 or 4 times. But this only happens the first time the movie is started. I can start and stop the movie all day long after this without problem. This isn't a form creation flicker problem, because I can start the player without starting a movie and everything looks good. But as soon as I hit the play button, the drop shadows flicker.

I've been beating my head against the wall trying to rearrange and optimize things. At this point I'm sure it's an obvious answer that I'm missing. In my desperation, I've gone so far as to let the form draw (with drop shadows), take a screen shot, remove the 4 drop shadow windows, and paste the image as the background on the form. This eliminates the flicker, because the drop shadow is now a "picture" on the form, but this prevents you from moving the form.

I wanted to use the normal desktop capture method of GetDC, BitBlt, ReleaseDC, but that doesn't capture the drop shadow. So I've had to resort to the print screen method, which I'd like to avoid.

Ultimately, I would like to address the base problem, flickering drop shadow windows. But I'll settle for the "picture" method unless anyone has any ideas.

Sorry for the long post, but I didn't have time to make it shorter.

Thanks,

Rich

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum