In my OpenGL application I switch between windowed and fullscreen mode using
Raymond Chen's solution:
http://blogs.msdn.com/b/oldnewthing/archive/2010/04/12/9994016.aspx
This works apart from two very annoying side effects when used in a
multi-monitor setup (only):
After the window mode was switched BOTH screens flicker/flash just in the
moment glViewport is called to accommodate the changed window dimensions.
Windows on the desktop from other applications are not painted correctly
after the switch until I e.g. minimize/maximize them (or do something similar
to force a refresh).
Does one know these effects and maybe also knows a solution?
ps: further tests showed that this only happens on my PC with an AMD card but not with my Nvidia card. If only one monitor is active it doesn't happen at all.
I am making an app that has fullscreen support (enabled via interface builder). The app has another NSWindow that appears from time to time as a sort of 'inspector' like in pages and such. However when the primary window goes fullscreen, the secondary one does not accompany it, and I have to go back to my desktop to see it.
Is there a way of fixing this? i.e. when Safari is fullscreen, you can open the activity window and it accompanies safari in fullscreen mode. Thanks a lot!
If you've actually built an inspector-style panel window (e.g., by dragging a Panel or HUD Window from the Xcode object library into your nib), it will automatically accompany the primary window in fullscreen.
I believe the minimum requirements are that:
collectionBehavior includes NSWindowCollectionBehaviorFullScreenAuxiliary
collectionBehavior does not include NSWindowCollectionBehaviorFullScreenPrimary
either collectionBehavior includes NSWindowCollectionBehaviorTransient or level >= NSFloatingWindowLevel
If you read the documentation on full-screen mode, most of this is explained, although a few details (e.g., when these values are checked…) need to be discovered through trial and error.
I am trying to mimic a Head-Up Display in a racing simulator, and I want to display a semi-transperant program window (i.e. a browser window showing a java applet) which limits mouse movements to that window only.
That way I can use a USB-track pad or the like to interact with the content in the dialog screen while still interacting with the racing simulator.
My question is mainly focused on the restriction of mouse movement, is this possible in Windows 7?
Regards
Use the ClipCursor API call - Make sure you undo any clipping when your window is deactivated or minimized.
I have a hidden process that waits for non-standard hardware button messages and runs an application (with CreateProcess). No problem with the user disturbing, it's an action that the user approved himself. Everything is fine when it's usual layout with taskbar shown and multiply captioned and non captioned- windows. But the situation is different in XP and 7, when the current application is full-screen. Full-screen application in this case is window without borders having exactly the same dimension as the screen. Windows hides taskbar for such application even if it's always on.
In Xp, it's ok, the taskbar is being shown in this case and appication (for example calculator) also, the full-screen app is still visible in areas other than the launched app's and taskbar'. But in Windows 7 nothing visual happens, the full-screen app is still on and if I switch to taskbar, the executed application is there. I tried to solve it with SetForegroundWindow, BringWindowToTop, even AllowSetForegroundWindow(GetCurrentProcessId()) call for a window handle found with CreateProcess-WaitForIntputIdle-EnumThreadWindows, no change. So did something change since XP related to full-screen windows that officially documented?
Thanks,
Max
I would imagine that, if you have your own hardware device, that there is some API for generating "real" user input. Clearly the legacy keyboard and mouse, and now USB HID drivers (many of which are usermode I think?) have access to an API to do so.
Synergy+ for example can generate fake keyboard and mouse events on connected PCs, and the consequence of the faked input is windows switching activation normally.
So, my initial idea is for your usermode "Device" application to synthesize actual keyboard messages - SendInput seems a likely candidate for "the API that can "fake" real user input events.
Then, use an API like RegisterHotKey in your "UI" app to respond to the hotkey combination your device app generates.
Now, (assuming that SendInput IS generating user input events at the correct level), you should (from within the WM_HOTKEY handler in your UI app) have permission (because everything was "user initiated") to change the foreground window (to yourself).
Vista introduced the desktop composition feature. In short, all windows are drawing to a memory bitmaps and the Desktop Window Manager is then composing these bitmaps and drawing on a full-screen Direct3D surface. Full-screen windows do not participate in the desktop composition and get to draw directly on the screen (mostly because the majority of full-screen apps are games that need real-time screen updates).
In particular, this means that when a full screen app is up and running, it is covering the DWM composed image and the user needs to switch to a DWM-managed window for the DWM to start drawing on top of the full-screen app.
I don't have a good solution for your problem, unfortunately. One way to solve it would be to add the WS_CAPTION style to your app and then handle WM_NCPAINT/WM_NCCALCSIZE/WM_NCHITTEST yourself. This would allow you to lie to the DWM that you are a regular windowed application, but change visually your NC area to look like you have no title. However, this does require certain amount of additional code and might be a bit more effort you want to invest.
Another way you can try to solve your problem is to explicitly minimize your full-screen application window when launching the new process. However, you will then have to solve the problem of when to maximize it back again.
Btw, you might find the comments on this post from Raymond Chen interesting.
Windows supports multiple desktops and my guess would be that the full screen up is using a different desktop than the default one (where your application will be shown). A desktop object in Windows is "a logical display surface and contains user interface objects such as windows, menus, and hooks". For example, screen savers normally are started on a separate desktop.
You can find out which desktop an application is running on using Process Explorer:
Set Process Explorer to replace Task Manager and to run always on top.
When your full screen up is shown, launch Process Explorer by pressing Ctrl + Shift + Esc
Within Process Explorer, select the full screen process and press Ctrl + H to display the handles of this process
See the value of the Desktop item in the list. Usually this would be set to Default
If you know what desktop this app is running on you can start your process on the same desktop by first calling OpenDesktop to get a handle to this desktop and then pass it into the STARTUPINFO of your CreateProcess call.
I have an OpenGL-based app that can run windowed or fullscreen in OS X 10.5. While in windowed mode, pressing the volume keys in the keyboard changes the volume setting (mute/unmute for example) and the OSX-drawn speaker icon overlay is drawn, as it happens with every other application.
However, in full screen mode, pressing the keys does change the volume setting, but no overlay is drawn - I can't figure out why, since I'm not doing anything different.
Any ides?
When you are in fullscreen, your app captures the display and nothing else can draw to the screen as the window server is not asked to do it's compositing.
If you want to have regular compositing in full screen, you must hide the menu bar, window title bar, and make your window full screen.
Google a bit, there are tons of posts on how to do that without capturing the display.
Edit: this might be of interest: http://developer.apple.com/mac/library/technotes/tn2002/tn2062.html