Creating a Windows Game Overlay Application? - c#

After playing quite a bit of Bad Company 2 over the last month, I'm getting kind of tired of Alt+Tabbing out of my game to change the song on iTunes. I've got a fairly good iTunes controller library already built for a previous project I was working on, and I'd like to create a WPF application mimicking the BC2 UI that would overlay the game when pressing a shortcut key, much the same way as the Steam Community overlay.
The only problem I foresee is getting my application to overlay BC2 when the user presses a specified shortcut key in-game. Is there a way to intercept a keypress from BC2 (or, really, any Win32 application) and use it to bring my app to the foreground?

In order to have a global keyboard shortcut, you need to use a Hook.
Here is a tutorial showing how to do Keyboard Hooks in C#.
That being said, doing the overlay may be difficult, depending on how the game is written. Many full screen games cannot (easily) have other programs run in front of them. I'd play with making sure that works correctly in your specific game first.

Related

Deactivate or disable Controller/Gamepad functions for another process in C#

I am writing a little Windows Forms application in C# to detect if a XBox Controller is connected and if it does, it maps the gamepad buttons to specific keyboard keys (with SharpDX and InputSimulator). After that it starts a game where I want to use my own configuration. This all works great.
Unfortunately the game has built in controller support and always prioritizes its own button mapping and the problem is, that it only supports 3 buttons on the gamepad.
Now is the question if it is possible in C# to forbid, deactivate or disable the use of the gamepad for another process so it (that specific process) thinks there is no gamepad it can use?
I don't know if this helps, but the games I want to use my tool with, are made in RPG Maker 2003 to make those games fully controller compatible. Maybe there is a way to just deactivate it in the game itself and I don't know how?

HoloLens DirectX C# app: Is it possible to show some text on the slate?

I've created my HoloLens application from the "Holographic DirectX 11 App (Universal Windows)" template. When I start the app, it shows a slate (a 2D window) in the HoloLens and I need to place it in the space. Then my app will work as a hologram (in an immersive view).
Before going to the immersive view, I want to check some conditions and show a message to the user, if the application cannot start.
Currently, my app does not have any XAML code.
It uses SharpDX library.
Can I write some text on the slate window?
I understand that this is an old question, but I will answer just in case somebody else needs to do something similar.
There are two possible ways to do that:
1) Perhaps the easiest way is to start your app as a XAML app and then, if everything is alright, to switch to DirectX mode, otherwise write your message on the main XAML window of the app. You could also provide a "Go Holographic" button for the user. There is a very good blog post here by Jonathan Antoine, which explains how to perform the switch between XAML and Holographic mode in detail- it also provides the source code
2) Another solution is to write your text to a DirectX texture and then paint that texture onto a rectangle in the 3D immersive mode. But that one is probably not exactly what you want since you'll need to switch to Holographic mode first and it is a fair amount of work

Screen touch simulation on Android

I'd like to create a simple application for Android that would automate some processes that happen in different applications that I don't have under my control at all. Is there any way to get pixel color and simulate screen touch while my application runs in background?
Let's say I want to wait for a certain pixel to turn red (#FF0000), can I use GetPixel(x,y) to get the color and then simulate a screen touch event such as a swipe across the screen?
I tried to Google this but I've got nothing useful at all and now I'm quite desperate about this.
I had to search a bit for this. I was also looking for this solution.
NO ROOTING REQUIRED FOR THIS:
If you want to repeat a sequence of steps like fill a form, repeat game steps because redoing is boring, You can try : FREP Android App from Play Store(Link).
If you want to add conditional scenarios like, when you play Clash of Clans with home Wifi, turn data automatically and disable wifi ( Because Airtel Wifi in India is unpredictable and can make you loose the clan war!!) use, Macro Droid from Play Store.
You can try these as well:
Mahiro
Many apps are available based on Tasker like, Auto Input. You can maybe code/write macro to make personal solution with this Tasker App.

Creating an information table for a game

I am interested in integrating an external project with the game Lineage 2. I do not have developer access.
I envision that my project would have a Form, that show the status of the top 100 Player V Player. I have had some luck with receiving the top 100 list and such that is not my problem
My problem is, how is it possible to get my form, to be overlaid on the game's screen. I would also like for it to be shown but not to receive input.
My experience with overlaying a windows form on top a full-screen application such as a game is going to be a very difficult task to do, but not impossible. You can find an example that was done in the XNA game development forms here: http://www.gamedev.net/topic/367591-mdxc-overlay-sample/

Send key to active window

Hey.
I don't know if this is possible, but worth a shot. Say there's a third party racing game which doesn't use the mouse. Is there a way for me to create a Windows Form app which listens for mouse clicks and transfers a corresponding key to the game/active window (e.g. Left click would send the 'Up arrow' key to accelerate the Right click would decelerate by sending the 'Down arrow' key). I've looked at the SendKeys method, but it doesn't work once the game becomes the active window. Any ideas? Thanks
if the game uses DirectInput for reading the keys, then SendKeys wont work, as DI works at driver level, and SendKeys/SendInput works at API level, which may be too 'high' for the game to see. you can Hook into DirectInput, and send it commands, but its not going to be a one liner, and if you're new to DirectX, you're not going to find it fun.
I don't know if it would work, and if it is possible, but intuitively, I would check if there is some kind of AutoIt Library for C#.
As far as I know, AutoIt has no problems with sending key press events to games.
A couple of methods to integrate AutoIt to C# exist on the internet, but so far, I haven't tried one of them yet.
Still you could give it a shot
http://www.lancelarsen.com/Blog/tabid/72/EntryId/48/AutoIt-C-Helper-Library.aspx

Categories