How to draw directly to an inactive display? - windows

I noticed that, when you are changing monitor resolutions in Windows with extra monitors attached, you can select "Show desktop only on [n]" (where n is the number of your various displays).
Is it possible to write a program that will open an extra monitor (not being used by Windows, but plugged into the video card) and write image data to it (directly or through OpenGL or something)? Where would I begin looking to accomplish this?

It does not appear to be possible to draw directly to a monitor device. It may become possible to some extent with the release of Nvidia and ATI's updated drivers for VR headsets, however it seems that these are only available for Oculus Rift at the moment, with other VR headsets forthcoming.
I haven't found any mention of whether or not they intend to open this feature up to general use with any plug-and-play monitor.

Related

WebVR - How to display on the headset screen AND a monitor screen

I am displaying a WebVR scene in a browser.
But only the user with the headset (an oculus rift) can see the scene.
My question :
Is there a way to see on another screen what the user see ?
I would like to give advices to the user (you can do that, you can go here too, etc).
Thanks
I use Open Broadcaster Software which can capture external monitors (like the Rift in extended mode) and individual windows. It's typically used for recording and streaming but you can use it for mirroring with its "Preview" mode. This works pretty well usually, although it does take some time to setup correctly and can be temperamental.
There are a couple of reddit posts about setup tips:
"Guide: Mirroring Rift display using OBS" by hargabyte: https://www.reddit.com/r/oculus/comments/2d1ujo/guide_mirroring_rift_display_using_obs
"My recording settings for DK2 apps using OBS" by eVRydayVR: https://www.reddit.com/r/oculus/comments/2gerrj/my_recording_settings_for_dk2_apps_using_obs/

MS Windows - Capture windows' gpu bitmaps

I presume dwm holds bitmap data of each rendered window in the GPU. Can I access this data? I want to use it as a texture in D3D (or preferably OpenGL). Screenshotting each window to RAM and back to GPU is too slow.
Ive seen other posts like : obtaining full desktop screenshot from the GPU
so Im doubtful, but maybe something has changed in the last 3 years.
Edit
So do all applications use Direct3D to draw all components? Would, say, this chrome browser's content, or file explorer's, or anything exist as an image in the graphics card or are only borders and such rendered through Direct3D/2D? Want to make sure before pursuing. BTW: my idea is a desktop for the Rift without running an alternate shell.

Multiple mouse cursors on Windows 7

We are using CPNMouse for an application running on Windows XP. One mouse device is detached from the normal event queue, so we can get it's position and events and draw the cursor ourselves.
Unfortunately, CPNMouse does not work on Windows Vista/7 (see here). Is there any library/SDK that provides the same capabilities on Windows 7?
Just to clarify - we want the "normal" cursor to be present and to draw another cursor, that should be mapped to a different mouse device.
Update:
CPNMouse is no longer supported and its previously "open source" withdrawn from SourceForge. Only this legacy documentation page exists on the official CPN Tools site.
Looks like only commercial products are available...
MiniFrame SoftXpand
MultiMouse
If anyone has a copy of the original source from SourceForce please post a link here... Assuming the original license was a standard SourceForge (open to share/expand) variant it should be okay for someone to fork it to a new project for continued development (of a free tool).
Take a look at the MultiPoint SDK, which allows for up to 25 cursors on the same display, which also supports Windows 7.
You should use the dsf from the windows ddk to create an emulated mouse device then any program can accept input from that specific emulated mouse device and draw the pointer it self. So any program you create will have multiple mouse devices in it. Its sad to say that its not possible to have multiple pointers in windows 7 OS though they specifically dont support it. So you would have to draw the poiner onto the screen yourself.
Im afraid the point is you need to draw a pointer yourself for the mouse
You want the "Raw Input" API which comes with the Windows Platform SDK: MSDN: About Raw Input

Porting a GUI from a pc to a wince device - issue is with the size of the screen

I have to port a GUI that is currently running on a pc, to a wince device. I have already compiled the code on a win CE platform, the problem is now with the size of the screen of the device which is smaller than some of the dialog boxes of the GUI. I could resize some them in resource view of visual studio 2005. I am unable to proceed further as a lot of screens have bitmaps mapped to them and i cannot just resize the dialog boxes without changing the corresponding bitmaps.
What is the best way to proceed- my last resort would be to disable the bitmaps and redraw them at a later stage.
is there some method of automatically mapping the size of the screen to all the dialog boxes so that they would automatically resize (alongwith the assocaiated buttons etc)
Honestly I think my advise would be to stop and think about the differences between the two contexts before event considering how you would scale the interfaces.
PCs and phones have completely different interaction paradigms and simply scaling from a PC to a phone is very unlikely to work. Even if you could, it's likely to produce an unsatisfactory user experience.
I would expect that the best way to proceed is to sit down and draft up a new UI for the phones. Then bring you back ground code across from the PC and code up the interface part to work with the new UI. If you code is designed according to MVC principles then you are just looking at recoding the controllers and redesigning the views.

Cursor disappears on bitblt

I have a windows application that scrapes pixels from the screen for recording (in the form of a video) to a custom screen-sharing format. The problem is that on machines using a software cursor, blitting from the screen with SRCCOPY|CAPTUREBLIT (so that layered windows also show up in the image) causes the cursor to blink, as described in Case of the Disappearing Cursor.
For single screen shots, this is not a problem, but when multiple screen shots are taken in rapid succession, the cursor blinks so fast that it sometimes seems to disappear altogether.
I have looked into using the Windows Media Encoder SDK (as described in a codeproject article, see below) because it doesn't cause the cursor to blink, but there seems to be no way to directly access the frame data. Unfortunately, both real-time encoding and the custom format are both requirements, which makes windows Media Encoder unusable for this purpose.
I have also tried the DirectX way (described in the same article, see below), and it seems to suffer from the same problem.
Has anyone else run into this problem? There must be a way around it - many commercial screen sharing programs have no such problem.
article: www.codeproject.com/KB/dialog/screencap.aspx
you can use Magnification API in windows vista or later.
i cannot find a good idea in windows xp.
What about using a mirror driver?
You are right, a mirror would certainly work. However, at the moment, I am trying to stay away from that approach because of the security and permissions concerns when installing under a user without admin rights. Correct me if I am wrong, but I don't think there is any way to install a driver without such rights. Besides that, it seems that that would be needlessly complex: there should be a simpler / less invasive way to do this. (I should have mentioned this in my original question)
Just copy the screen and the cursor separately and overlay them.
The thought I had to overcome the flicker is to "manually" draw "your own copy of the mouse", then make the BitBlt call, or to call BitBlt with just SRCCOPY then manually capture any visible transparent windows over the top of it. I don't know how the commercial stuff does it (or the windows media encoder apparently does).
ref: http://us.generation-nt.com/xp-bitblt-captureblt-option-help-26970632.html

Resources