Simple fullscreen movie

Share your advanced PureBasic knowledge/code with the community.
boop64
User
User
Posts: 14
Joined: Tue Nov 18, 2003 12:42 pm
Contact:

Simple fullscreen movie

Post by boop64 »

Code updated for 5.20+

Well, I got bored and was messing around with the playmovie() function to see what funny things i could do with it. I came up with an interesting little program.

There are two window id's you can use in this example to play a movie on. The first one is 'hDesk' this plays the video directly to your desktop giving you a fullscreen video w/o much effort. The second is 'hTray' this one really has no use but it's pretty funny, it will render the video over your tray window. 'hTray' could be used if you wanted to play a joke on a friend or something. Anyway thanks for listening.

Boop64

-----------

Code: Select all

hDesk = GetDesktopWindow_()
hTray = FindWindow_("Shell_traywnd", "")
If InitMovie() = 0
  MessageRequester("Error", "Can't initialize movie playback !", 0)
  End
EndIf

MovieName$ = OpenFileRequester("Choose the movie to play", "", "Movie/Audio files|*.avi;*.mpg;*.asf;*.mp3;*.wav|All Files|*.*", 0)

If MovieName$
  If LoadMovie(0, MovieName$)
    ResizeMovie(0, 0, 0, GetSystemMetrics_(#SM_CXSCREEN), GetSystemMetrics_(#SM_CYSCREEN))
    PlayMovie(0, hDesk)
    
    Repeat
      Delay(1)
    ForEver
  EndIf
EndIf
End
darklordz
Enthusiast
Enthusiast
Posts: 119
Joined: Wed May 21, 2003 1:44 pm
Location: Netherlands
Contact:

Post by darklordz »

nice effect does movieseek also work?
boop64
User
User
Posts: 14
Joined: Tue Nov 18, 2003 12:42 pm
Contact:

Post by boop64 »

All the movie functions should work like normal. It's playing the movie on a windows just as if you created the window your self. So as far as I know movieseek should also work. Again I just did this because I was bored and I saw people were having problems getting fullscreen video. Anyway I hope that helps.

Boop64
TIGER
User
User
Posts: 81
Joined: Mon Feb 23, 2004 8:33 pm

Post by TIGER »

And how to close desktop after playing movie ?

And is there is a way to put other media (like images) on desktop ?
PIII450 128RAM TNT2
dell_jockey
Enthusiast
Enthusiast
Posts: 767
Joined: Sat Jan 24, 2004 6:56 pm

Post by dell_jockey »

on Win32: Alt-F4
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com
Post Reply