Regarding desktop share concept - c#

i have developed two a small apps by which i can send desktop picture with mouse position to another apps. another apps receiving the picture and shows those picture on picture box.
1) so i want to know that how could i send my all mouse keys and keyboard activity in very structure way to another apps which is sending picture.
2) when another apps will receive my mouse & keyboard activity then they will fire properly.
so please tell me how could i send mouse & keyboard activity very structure way and another things is to know that how could programmatically fire those mouse & keyboard activity on another machine. here i am developing this apps with c#. so please give me the concept as a result i can code it in c#. thanks.

Sending a picture (or any data) over a network is relatively easy.
Intercepting and re-creating Mouse and Keybord actions is entirely different. It will involve a lot of lowlevel hooking into Windows, no ready-to-use libraries.
You will have to be proficient in Interop and Marshaling, and maybe C# (.NET) just isn't the best tool for this job.

Related

mouse control from another computer in c#

I am writing a program similar to team viewer, which is an application that allows one computer to control other (by viewing the screen and able to move his mouse and control his keyboard).
In order to do so i have managed to share the screen of a computer with another one, and the only thing left is to enable the mouse control. The program is written in c#. The screen sharing is working using 'ffmpeg' library.
The details that i have about the second computer, in case i am the computer that is willing to "take control" of the other, is his 'ip' address.
Does anyone know how to do so or where can i found the solution?
Take a look at this: How to move mouse cursor using C#? it should get you started.
You will need to create some kind of protocol / transport to issue the remote calls. But this shows you how to interract with the mouse programaticly.

How Can I Globally Detect Touch-screen Events in the Windows 8 Metro UI?

I am developing a WinForms C# application, that needs to know when the computer is not "idle", that is, that a user is actively using it. I can detect keyboard and mouse activity in both the standard desktop and Metro (I think thats what they call it). I can also detect touchscreen activity in the standard desktop - these events are detected as mouse events.
However, using the touchscreen in Metro, none of these events are raised. I have tried this project: http://globalmousekeyhook.codeplex.com/ as well as writing code to hook into the Windows SetWindowsHookEx API with no luck.
I spent some time investigating the WinEvents API too, but can't find anything there that will help.
Anybody know if this can be done? And how?
There happens to be a nice function for that but unfortunately it is C++, so you'll have to P/Invoke it.

Access Windows Media Player buttons programmatically

I'm making a C# windows application, in which I've embedded a Windows Media Player in my form.
Now, instead of using the player in a normal way, I want to access its buttons, for e.g I want to hide its "Play" & "Pause" button.
In short, I want to customize the player according to my needs.
How can I do so?
You will have to hook the creation of the app. Mainly the windows mesaage WM Create or WM Paint.
There You have to check which window names the corresponding controls have. There are several tools to examine such things during runtime, which all use the windows hooking mechanism. However, I think this will fail for metro apps. You must read about hooks . Check codeproject.com for that, because You also will need to create at least one dll. And there is a good example in c, which surely can be ported to c#.Can I give You furthrer info?

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

Creating a Windows Game Overlay Application?

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.

Categories