PDA

Click to See Complete Forum and Search --> : Screen Saver in picturebox control


Mike B
Jul 30th, 1999, 11:35 AM
I need to know how to program a picturebox control to view a scaled down preview of a selected screen saver.

Mushroom Realm
May 14th, 2003, 09:33 PM
Just doing some grave digging. I wonder if this person will even read this....

Use FindWindow() to get the hWnd of the screensaver, and then SetParent() to put it into the picturebox.

It's kind of neat. You can move it around inside the picturebox, without adding any code of your own.

CodeRonin
May 17th, 2003, 11:05 AM
...I could even use animated gif's or videos in a picture box?

Mushroom Realm
May 17th, 2003, 12:08 PM
I think there might be a way to use animated gif's, but for movies I think you have to use some form of multimedia control. I'll look it up and post back.

*edit*

SetParent changes the parent value of the window. So if the window is a regular window it becomes a child window of the parent that you specify.

CodeRonin
May 17th, 2003, 12:09 PM
Thank you

Mushroom Realm
May 17th, 2003, 12:14 PM
New discovery: You can pull a child window out of its parent and make its parent the desktop. So basically you could have a fully coded child window as its own window.

To do this you just have to pass the SetParent() API the desktops hWnd as the parent.

Mushroom Realm
May 17th, 2003, 12:19 PM
Bad news, sorry

If it's an animated GIF then you need the AnimGIF control, but if it's a series of bitmaps, load them into an array of pictureboxes at runtime. Make another picturebox and add a timer...