Locate DirectX viewport - c#

How do I locate the coordinates and size of a DirectX game?
My current code uses window sizes (user32.dll, GetWindowRect), which includes window chrome, but I want it to work accurately even if chrome is customized or if there is no chrome (e.g. fullscreen).
As an example, Fraps can create an overlay of the FPS of a game in a particular corner. If I wanted to do that, how do I find that window viewport?
Thanks in advance for your insight.

There is a GetDisplayMode function.

Related

Custom Startup Window unity3d For Stand alone windows

I am trying to make a custom Startup window Or Before start Window for unity3d Standalone.
I do not know how to start Working on It i have Researched but got noting that can point me on the direction or a Kick start.
Is it even Possible to Do it As i have seen option in Player Settings--> Display Resolution Dialog-->Hidden By default But how dose it work and how i can set up my own window
If you have the Personal edition, you can't do a true customized start screen, as per their licenses page: https://unity3d.com/get-unity. You also cannot turn off the default Unity startup screen without using the Professional edition.
The Player Settings -> Display Resolution Dialog -> Hidden by Default options is to enable/disable a screen allowing the player to set the resolution before game start. Allowing the player to do this can have some undesired effects, depending on how you've set up your game's resolution. On this resolution screen, you can set a splash image by scrolling down the Player Settings inspector a bit.
To make a pseudo-startup screen that occurs after the actual Unity startup is not actually difficult. Take the image you want for your startup window, put it on a quad. Set your camera so that the quad fills the whole camera space. Add some light and you're done. You can add effects or animation as well. There are a number of other ways but this is probably the easiest.
Edit: I only have the Personal edition myself so I can't confirm any of the stuff in the following link works firsthand, but I expect you will find it and/or the links it contains to be very helpful in your efforts (the links referenced in it give quite a few worthwhile looking suggestions to accomplish it that I am unable to test):
https://gamedev.stackexchange.com/questions/72087/can-i-legally-remove-the-default-unity-splash-screen-by-removing-it-from-the-apk

Complete interaction through a form using C#

I am making an overlay program with C# that will have an overlay for games. I am currently using a borderless form with a transparent background and a picture box to draw pictures to the screen, but I can't click the window behind the form. I have set the form to be always on top so that I can play games and the UI stays, but every time the mouse goes over the form in the game if I click the focused window switches to my form, preventing game interaction.
I have tried using functions to just draw images to the screen without using forms, but I cannot work out how to do that.
All I want is things like an external menu/crosshair and such, for use in minecraft. As for the menu, I could make my own media controls and such, and the crosshair would be useful because I hate the default crosshair. I could draw shapes to the screen, but if I don't use pictures the crosshair might look tacky.
A possible solution is a per pixel alpha blending window.
Here is a good starting point: Per Pixel Alpha Blend in C#
The example source code should give you the idea.
Hope this helps

Drawing on the backside of a WPF Window

I have quite an uncommon question: Does anyone know whether it is possible to draw something on the backside of a WPF Window?
Normally people create Controls or draw images on the front side of a WPF Window. However, I would like to draw things on the backside. Here is an Image taken with the Snoop tool. Snoop has the functionality of viewing a WPF Application in 3D. Using the so-called Zoomer it is possible to look behind a window.
I would like to either draw an Image or put a Control so that you can see it with using the Zoomer functionality of snoop at the back of the application.
Has anyone got an idea of how this could be done?
Thanks,
Christian
There is no backside.
What most applications do is simply replace the control/window by another one as soon as it has rotated by 90 degrees.

WPF Firefox 4 Top Bar?

How would one create the top bar such as in Firefox 4's Orange bar?
I don't want to do my own window class as I still want to be hardware accelerated rather than sofware rendered.
Is there a way to do this?
You'll need to do your own Window drawing, with custom chrome, in order to achieve this type of effect. Here is some sample code showing the technique.
I don't want to do my own window class as I still want to be hardware accelerated rather than sofware rendered.
With WPF, provided you're on a proper rendering tier, the window will still stay hardware accelerated, as WPF uses hardware acceleration for its rendering anyways.

Get hidden IvideoWindow Image

i need to get Image of hidden IvideoWindow ("ActiveMovie Window"), which shows webcam preview. As far as i can tell preview isn't overlay, it doesn't have overlay features, i can use printscreen on it, but i need window to stay hidden all the time, so that won't help. Also PrintWindow() api function returns me black screen.
Programming languages: c#, c, c++, java, pascal.
Operating system: Windows XP.
Any ideas?
The trick is to show the window but outside the desktop. Set the left position at the desktop.width+1 (not screen.width, because users may have multiple screens) and then make it visible.
That way normal functions like printscreen work and users still won't see it.

Categories

Resources