C#/Metro implementing background service - c#

Is it possible to implement service that starts on startup and monitors users acitivity only using Metro WinRT and API? I need somehow figure out a way to get information that user started watching video. I know that it is possible to implement it in normal .NET (by kernel functions), but I would like to know whether this is possible on WinRT tablets. Maybe by creating some triggers.
Thanks

No, fortunately as Raymond said - it is not possible. You can monitor only applications that you create yourself with code that comes with them. Or you could create a library that does monitoring you want and ask developers of applications to use it - basically what vendors of analytics libraries would do.

Related

Real User Monitoring for a C# Desktop App

I am looking a viable approach to record the usage / performance of various parts of a C# desktop application. I see strong parallels with the web focused Real User Monitoring technique and have access to Datadog to process my data.
Is RUM outside the web a viable approach? I believe I will have to implement the equivalent of the JS Datadog SDK if I want to go down this road, is there a way to do this out of the box?
I want to be able to track user usage for certain function calls and capturing exceptions seem sensible.
There are some event model disconnects between the desktop and web but RUM can be used with Android and iPhone apps as well. I implemented this using the json-schema files in the Android SDK and a bit of trial and error on how I wanted to map function calls into the RUM event model.

Is it possible to run a .Net UWP Class Library on Azure?

I thought up an idea for a website that would involve some video editing happening on the web server. Microsoft UWP has a library that does the video editing functions I'm looking to perform... Amazing!!
My problem is I don't know if it's possible to get my website to run UWP code on Azure. Web Jobs seem like what I'd prefer to use to kick off this code, but web jobs don't appear to be able to run UWP code and without UWP code I don't see a library that can perform the video editing I'd like to do. Does anybody know if it's possible to run UWP code on Azure? If so, how?
I don't think WebJobs are especially suited for this scenario. They are part of the WebApp platform as a service offering that abstracts the underlying operating system for you to be able to focus on building the code itself and deploy as easily as possible.
UWP on the other hand is a Windows-specific app platform which has many requirements including running on Windows 10. Because you don't know which concrete operating system the web app will run on, it is not easy to say if the APIs would work.
That said, you could theoretically use UWP APIs in a web app as well, because there is a UwpDesktop NuGet package that allows it mainly targeted for desktop apps. It is a long shot but you can certainly try it.
As a preferable solution, I would still look to find another library that suits your needs, as the choice on NuGet is pretty broad and one of those should be sufficient.
I would suggest taking a look at azure functions
These have about the same working as webjobs, however expand beyond the limitations of webjobs. These are also more versatile in what they can do and how they can be created.
webjobs vs functions

Getting input into a process

While talking with a friend over yahoo messenger, I told him would be really cool to make a bot to answer with generic messages when someone starts a conversation. Upon thinking about what I told him, I realized it would be quite interesting to do something like that. The problem is that I don't know much about win32.
So my question is this: how do you 'link' a process to both another one and the windows environment? The goal would be to have an application running in the background which makes some sort of a query to see what windows are opened and when a new yahoo messenger conversation window appears it should send a list of keystroke events to that window.
I could use either C# or VC++ for the programming part and I can use any help: either specific answers or tips that could help me - e.g.: what to google for. So far my google research only came up with some apps/dlls/code that do that for you and some scripting stuff and I'm not exactly searching for that. I want to do all the work myself so I can learn from it.
It seems like you basically want to control other applications.
There are roughly 2 ways to do this on windows
1 - Use the low level windows API to blindly fire keyboard and mouse events at your target application.
The basic way this works is using the Win32 SendInput method, but there's a ton of other work you have to do to find window handles, etc, etc
2 - Use a higher level UI automation API to interact with the application in a more structured manner.
The best (well, newest anyway) way to do this is using the Microsoft UI Automation API which shipped in windows vista and 7 (it's available on XP as well). Here's the MSDN starter page for it.
We use the microsoft UI automation API at my job for automated UI testing of our apps, and it's not too bad. Beware though, that no matter how you chose to solve this problem, it is fraught with peril, and whether or not it works at all depends on the target application.
Good luck
Not quite the same domain as what you're looking for, BUT this series of blog posts will tell you what you need to know (and some other cool stuff).
http://www.codingthewheel.com/archives/how-i-built-a-working-poker-bot
If you really want to learn everything from scratch, then you should use C++ and native WIN32 API functions.
If you want to play a bit with C#, then you should look the pinvoke.net site and Managed Windows API project.
What you'll surely need is the Spy++ tool.
http://pinvoke.net/ seems to be the website you are looking for. The site explains how to use Windows API functions in higher level languages. Search on pinvoke for any of the functions I've listed below and it gives you the code necessary to be able to use these functions in your application.
You'll likely want to use the FindWindow function to find the window in which you're interested.
You'll need the process ID, so use GetWindowThreadProcessId to grab it.
Next, you'll need to use OpenProcess allow for reading of the process's memory.
Afterwards, you'll want to use ReadProcessMemory to read into the process's memory to see what happening with it.
Lastly, you'll want to use the PostMessage function to send key presses to the window handle.
Welcome to the wonderful world of Windows API programming.
Check out Autohotkey. This is the fastest way to do what you want.

wp7 add alarm entry

Is there a way to programmatically add an alarm entry from the app I am creating?
No, currently the SDK doesn't offer any capabilities to interact with systems applications like the Alarms app from a third-party application. I am sure there is a native hook for this (considering the way apps interact internally), but it's not publicly available right now.

I'm developing a simple cross platform system tray application. Here are the requirements, which tools should I use?

I hope you can help!
In brief, what I need is something like a cross platform web browser, with little or no chrome, that is easily distributable and allows the (local and remote) HTML pages running in it to receive messages (JavaScript?) when system global hotkeys are pressed.
I'm developing a desktop application which will utilise an existing web-based REST API. I would like this app to be cross-platform (Windows, Mac OS and Linux) and have a consistent interface across all platforms. The app runs in the system tray and uses global hotkeys for convenient access to a lot of it's functions without having to open the main UI window.
I have already written a rough initial version of the app using C#/Windows Forms, but there are a few issues. It currently uses unmanaged Win32 code to provide support for global hotkeys, which is not cross-platform even if I ported it to Mono. Plus, it's really not very pretty...
Ideally, I'd like to build the UI using traditional web technologies like XHTML/CSS and use JavaScript/AJAX to communicate with the remote API, which is why I thought Adobe AIR would be a good solution—but unfortunately it still doesn't support global hotkeys. I've also looked at XULRunner but I'm not sure I properly understand what that's intended for.
So the basic requirements for whichever combination of tools I will use are:
Allow me to create the user interface in XHTML/CSS/JavaScript
JavaScript to remotely communicate with the web API via AJAX
Allow the app to show—and be accessible via—a tray icon (in whatever OS it's running on)
Allow the app to respond to global hotkeys (again, in whatever OS it's running on)
Does anyone have any advice for me on this? I'm open to any suggestions and examples, no matter the language or tool.
Edit: I just stumbled across Nokia's Qt Toolkit, does anyone have any experience with this?
I think AIR application is a good solution. For the global hotkeys there are some "alternatives" Can I assign a global hotkey to an Adobe AIR app?

Categories