Thanks all, this is what I have since I want to run the movie full screen on the second screen. I have the movie player object set to auto resize and pinned to all edges of the window. The way i’d like this to work is the main window on screen 0 will control content playback on screen 1 using various buttons on the main window. Does this mean I need to set up the second window on screen 1 within a class (so I can call it from the main window), or just declare the second window as a global so I can reference it from anywhere?
Dim myscreens as Integer
myscreens=ScreenCount
If (myscreens=1) then
MsgBox "You’ve only got one monitor. "
else
dim w as new MoviePlayWindow
w.left = screen(0).width+1
w.width = screen(1).width
w.top = 1
w.height = screen(1).Height
w.FullScreen = true
w.show
end if
Sneaking up on it. I created a global property ‘PlayerWindow’ in module ‘PlayerModule’. This code then properly opens the window. (Thanks Michel) The window has an embedded MoviePlayer control called ‘MoviePlayer2’. My thought was I could reference the MP object with a call to the global property, i.e. "PlayerWindow.MoviePlayer2.Speaker = TRUE’ just as I do from a local variable. I tried creating methods in the window to set the MP object property, but I don’t see them as an attribute of the global property. Obviously I’m missing something very basic.
I’ve read through the intro docs.Most of the RealBasic books seem to be pretty dated. Any type of reference book you can recommend that might give me more insight for things like this? Or, are the older books OK even though they’re dated?
Dim myscreens as Integer
myscreens=ScreenCount
If (myscreens=1) then
MsgBox "You’ve only got one monitor. "
else
dim PlayerWindow as new MoviePlayWindow
PlayerWindow.left = screen(0).width+1
PlayerWindow.width = screen(1).width
PlayerWindow.top = 1
PlayerWindow.height = screen(1).Height
PlayerWindow.FullScreen = true
PlayerWindow.show
end if
That’s how that works. Check to make sure you have the right scope for everything involved.
Reading your code though, be sure you aren’t creating a new window each time you’re trying to access the original one.
Hard to tell without seeing how you’ve got your project set up.
Edit: I forgot (not immediately on your mind when you think of these things) that to get the controls to show up, the property must be your window subclass and not just Window. See demo project below for example.
Ok, my proof of concept is almost baked. The essential thing I missed is having the global property type set to the name of my window (I had it as object). As soon as I changed it to MoviePlayWindow I was good to go. So, now the movie opens and plays on the second screen. The difficulty now is that my second screen is big and the movie opens as 1080p (1920x1080) even though the window containing the movie player is full screen an the movie player object is auto resize and pinned to the window extents. Before I open the movie to play, the movie player object fills the screen.
Is there a way to force the movie player object to full screen to match the window? I tried to set the width, but that doesn’t seem to change the object.
Thx for all your help, you’ve been most gracious. Once the proof of concept functions barely, it’s time to start from scratch and build a real program!
OK, got it figured out. I had the MoviePlayer set to ‘auto resize’ thinking that this is what I wanted for the object to resize with the window when it went full screen. However, when the movie opened the opposite happened. The MoviePlayer resized to the default size for the actual movie (less than full screen). As soon as I disabled the auto resize the movie opened at the full extents of the window. Duh!