Access desktop application UI - user-interface

This will be OS dependant so here goes:
Windows 7/8/10
I'd like to be able to access a desktop application UI from another application (that I've written).
I'd like to be able to simply pass some mouse and keyboard inputs from my application to the external one.
Is this possible and if so, where do I start? Is there some Windows API that I can do this with?
I know I can use the Microsoft detours API to hook into Direct3D applications/games, but not sure about regular desktop applications.

Related

How to list down all the processes with User interface only on Unix and Windows?

I am building one desktop application using electron js + Node Js. This will be an desktop usages monitoring application.
My target is to list down all the open applications names and their process IDs if possible which are having user interface. e.g. Notepad, MS Office applications, Visual studio etc.
Ultimately I need to control which applications can be opened on the desktop and which can be blocked from usages. I can not have a list of all the applications in the world and then check those one by one via process list. So as a work around, If I get the list of all the open applications with UI associated with it, I can at least show the user if this application is allowed to use or not.
Platform I am using is Unix/Windows/MacOS.
If there is no straight forward solution to it, can we think of something like using OpenCV and understand image by some algo to check the open application windows? Because any way I am interested to find the application on the top of all i.e. active.
Is there any way to identify such processes/applications?

Can Windows store apps generate UI Events?

I am considering writing a Kinect v2.0 Gesture -> Keyboard/Mouse event translator so I can control video games. Since I will be using Microsoft's SDK, cross-platform is out-of-the-question; it seems natural to distribute this through the Windows store. However, I know Windows store apps have significant restrictions. Can a Windows store app:
Run in the background (possibly with an elevated priority to ensure that the game doesn't miss input)?
Create user input events like "key-down" and "mouse move" that will be read by other applications?
Looking at Microsoft's capability page didn't seem to give me a definite yes or no.
You'll need to write this as a desktop app. Windows Store apps run in a sandboxed context with limited access to the system. They cannot interact with other processes as you'd need, and they cannot inject input events.

Win32 Console application or CLR -->windows form application?

I have to have a form as a gui,but i also need to write using win32 API as i need to create another process the moment the application is launched...
I created Win32 console-->empty project..then there was an option to add windows form as UI...Is it possible????...as i have chosen the base project to be win32 console application.
But i really need the form in the application.
C++/CLI is perfectly able to show a Windows Form in a console program, just as a windows console program is perfectly allowed to call CreateWindow. However, if you choose console as the output file mode then the console window is still going to show up to your user in addition to whatever forms you create.
You don't need to use the bare Windows API to create processes. See System.Diagnostics.Process.

How to make an Invisible / Hidden Cocoa Application

I want to develop a application like http://orbicule.com/undercover/ or
http://hiddenapp.com/.
I know how I could do that for windows but I have totally no clue, what kind
of approach I would need for mac os x, cocoa/xcode.
Is there anything I should be aware of when building applicatons / background services
with no GUI for mac os x?
The service will post data to the webpage with the usual data like geo location & IP
information about the machine so it should be able to access the internet too.
Please lead me to the right path.
It's fairly straightforward.
Go to:
Information Property List Key Reference
http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Introduction/Introduction.html
in the Launch Services Keys, you will see one called "LSBackgroundOnly" simply define this in your Info.plist and set it to true.
<key>LSBackgroundOnly</key>
<true/>
From the documentation:
LSBackgroundOnly (Boolean - Mac OS X)
specifies whether this application
runs only in the background. If this
key exists and is set to “1”, Launch
Services runs the application in the
background only. You can use this key
to create faceless background
applications. You should also use this
key if your application uses
higher-level frameworks that connect
to the window server, but are not
intended to be visible to users.
Background applications must be
compiled as Mach-O executables. This
option is not available for CFM
applications.
Your application will be a background application.
Give System Startup Programming Topics a read. Create a command line tool project, not a Cocoa Application nor a Cocoa Document-Based application. To provide a GUI to interface with it you'll want to use a separate application (ideally one you don't have to install with the "hidden" app, since you seem not to want it to be easily discoverable).
With the exception of AppKit (UI) stuff, the rest of the basic Cocoa frameworks is still available to you via the command line. This means you'd write the main logic of your app (the non-GUI parts) the same as you would otherwise.

How can Windows Sidebar Gadget communicate with my desktop app?

I've got a .NET 2.0 Windows desktop application (time-sheets) which i develop and wanted to add a Gadget interface to it (so that app runs hidden and is controlled via the gadget).
What is the easiest way to get my gadget to communicate to my app?
An idea that i had was to have a built-in web server inside the app, and the gadget controls communicates with the app using ajax. However i'm hoping there's a simpler solution.
You didn't specify what technology the gadget and app were written with, so it's hard to answer. Assuming you can use .NET, WCF with a named-pipes binding would be very simple. Just a few lines of code to set it up.
We use win32 APIs in one of our gadgets' ActiveX control to communicate with other instances of the same gadget. Unfortunately, I can't give you the code (because I don't have permission and I don't write the .net stuff) but it boils down to using a window (in your case the application window) as a server and the gadget ActiveX control as the client and use the SendMessage function.
You can see an example of using COM interop with windows desktop gadgets at http://www.codeproject.com/KB/gadgets/GadgetInterop.aspx
NB: make sure the interop assembly is in the application's directory and NOT the gadget directory, otherwise you'll run into problems when updating/uninstalling the gadget.

Resources