There are examples out there for API calls in making a window in OSX full screen. Does anyone have examples of how to accomplish this in Windows? Does Windows 8 support full screen apps like in Windows 7?
Wouldn’t you want to avoid using OS-specific API calls, to ensure that your code is more easily portable between different platforms?
With conditional compilation, it should be easy. For example:
Sub EnableFullScreen(Extends w As Window)
#If TargetWin32 Then
// Code for Win32
#ElseIf TargetCocoa Then
// Code for Cocoa
#Else
// Just not available
#EndIf
End Sub
At my work place, I have several traveling works who routinely work on small laptops. Thus, for me the feature of going full screen far, far outweighs the above #If conditional compilation. Our workers are on two platforms only, Windows and OS X.
Fair enough, was just wondering.
Since full screen capabilities are important in your user requirements, it makes sense to access the API’s directly combined using conditional compilations.
Not sure about Mac, but have you looked at the “SetWindowPos” Windows API call to set your window to fullscreen?
You can also use it to make your windows stay on top of other windows.
Do you know if making it TOPMOST will place it over the task bar as well? Are you suggesting that I use that and just move the x, y, width, height to the same as the Screen Resolution?
Yes, it will. For all practical purposes, the taskbar is just another window, and when you make your window “topmost” it will be on top of all other windows.
Try placing the following code in the Window1.Open event handler of a new project as a test:
#if TargetWin32 Then
Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Int32, ByVal hWndInsertAfter As Int32, ByVal x As Int32, ByVal y As Int32, ByVal cx As Int32, ByVal cy As Int32, ByVal uFlags As Int32) As Int32
const HWND_BOTTOM = 1
const HWND_NOTOPMOST = -2
const HWND_TOP = 0
const HWND_TOPMOST = -1
call SetWindowPos(Self.Handle, HWND_TOPMOST, 0, 0, Screen(0).Width, Screen(0).Height, 0)
#endif
Of course, you still need to make the window border-less if you want the full effect of “fullscreen”.
Just a question, why not just set the “FullScreen” property to ON in the inspector (much easier than API coding)?
Hm. I’ve overlooked that because on OSX it doesn’t do anything of value. When you flip it on OS X windows, it makes the window borderless and sizes it to the whole screen, but the dock, menu bars and other windows still appear on top of it. I didn’t realize that FullScreen works on Windows properly?
Yeah, it works great on Windows, and fullscreen can even be set/unset during runtime.
You’ll only have to access APIs for your OS X installs if you need proper fullscreen on OS X, by the sounds of it.
Now I’m wondering how fullscreen it’s handled on Linux. Will have to boot up my Ubuntu at some point to have a look.
[quote=17941:@Alwyn Bester]Yeah, it works great on Windows, and fullscreen can even be set/unset during runtime.
You’ll only have to access APIs for your OS X installs if you need proper fullscreen on OS X, by the sounds of it.
Now I’m wondering how fullscreen it’s handled on Linux. Will have to boot up my Ubuntu at some point to have a look.[/quote]
Alwyn, thanks for the help with this! With that property, it is very simple, I wasn’t expecting that. I guess I was just use to it not doing what I wanted on OS X (and that’s my primary platform) that I forgot about it on Windows :-/
Thanks!
You’re welcome
Pretty sure that between macoslib and windows functionaility suite these are most;y if not completely written for you
drag drop & use
Where is the Windows Functionality Suite?
What about full screen - no border/task bar in Linux? I’d like to do a game that only shows graphics/text onscreen (player interface is serial only)
Thank you - can you tell I’m brand new to Xojo? Works like a charm on both Windows and Ubuntu tried the OpenGL pinball example YEAY!!! Now to get to work…
If you are interested in OpenGL programming with Xojo, I’d like to invite you to visit www.xojo3d.com. There are some introduction tutorials on how to use OpenGL in your projects.