How to track WinRT applications (in Win32 it was simple)? - windows

In "old" times I created simple tool for Windows users, which tracks what they were doing in the front of computer (where simple activity monitor). I was using Win32 api and functions like GetForegroundWindow, GetWindowThreadProcessId, etc.
Yesterday I installed new Windows 8 and tired to run my program. I got 50% success: for "classic" desktop it works like always:).
For Metro UI I just got one application: WWAHost :( without any details.
So my question is: is there a any way for tracking active application in Metro UI?
Thanks for help
UPDATE:
I'm trying to access Metro UI app from Win32, I know that accessing Metro app from another Metro app is impossible

You see, in WinRT, your application is the top-most application. And when your app is not the top-most application then your threads are suspended and the kernel will not schedule any more operations for your app. End of story.
This means what you are wanting to accomplish cannot be done in WinRT. You are thinking more like a resident app or a service with access to the desktop. Those apps have two advantages. 1) they are always running. And, 2) they have the API to do what you are wanting.
WinRT intentionally puts apps in a sandbox so that the user's experience, performance and battery life are protected. Your scenario and scores more like yours underscore the continuing need for desktop apps. (as long as there is a continuing need for those types of apps ;)).
Sorry, if this is bad news.
As for enumerating other apps. This is also not possible. You cannot know if another app is installed or if it is running. You can call out to another app through protocol activation or file activation or (in a sense) through the share contract. But you are unaware if they get the message and if the user has it installed in the first place. And this is by design.
It is worth mentioning that you can pinvoke to Win32 APIs in your WinRT application. It causes lots of problems and can create a headache to get certified into the store. But even then, not all APIs are open to you. And you will find this particular use case is a non-starter.

I am sure this will not be possible. With Windows 8 'Metro' only a single application is active. All other applications will be in a suspended state whilst the topmost application is running. This makes it impossible to write an application that monitors other applications which are currently executing.
See the numerous articles on the Windows 8 app lifecycle.

Related

How to programmatically launch an app in Xbox S on boot

I've been tasked with developing an app for Xbox to match our existing suite of apps for Windows, Mac, Linux, Chromebook, iOS, and Android. One of the key features of our app is that it must launch automatically on boot.
Is there any way to create an app that will launch automatically on boot in Xbox? I'm focused on Xbox S at present because I have one I can test on.
The auto-launching portion of the app doesn't even have to have a user interface. It can, but it doesn't have to. So even just a background service would be enough. But some kind of custom code has to launch on boot, or else the platform just isn't viable for our product.
I've Googled and Googled and cannot find anything that speaks to this (which seems to me to indicate that it cannot be done). I suspected antivirus software would launch on boot, so perhaps I could try to figure out how Norton does it. But there doesn't seem to be a Norton for Xbox, or any other antivirus software for Xbox for that matter. It even looks like the user himself cannot manually set any of his apps to launch on boot.
If this is possible, and you know how to do it, please provide enough instructions (or a link to something that does provide them) that I should be able to create a "Hello World" app (or something similarly trivial) that launches on boot.
If you know for a fact that it isn't possible, please let me know that it is impossible, and also tell me how you know this, so that I can stop spinning my wheels.
Thank you so much!

VS2013 Application Insight for desktop applications

I have created one desktop application using MFC. It contains different tabs like settings, about etc. I want to know hit count of these tabs i.e. how many times user clicks/opens these tabs. Can I use Application Insights or is there any other method to do so.
To get started though, from SDK perspective we can support other types of apps like desktop apps. Here are the steps required to setup it up manually and the code required to get metrics, events, traces, etc sent to the application insights service.
Desktop App with App Insights
This feature, it seems, is quite wanted and you can vote for it on the official site: https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/5484795-add-support-for-desktop-apps-to-application-insigh.
I also agree this will be awesome if they make it available for desktop applications, so fingers crossed!
edit: As it seems, on the upper link I provided, on December 05, 2014 they added support for this in the following matter:
While desktop apps are not listed as targeted app types for Application Insights, it’s possible to get instrumentation for desktop apps using Application Insights SDK. Please refer to this thread for more details: Application Insights for WPF Application. At this point Application Insights team believes this should unblock most of the users who voted for this feature, and we are closing this item and releasing your votes back to you. Please let us know if there is another aspect that blocks using AppInsights for desktop apps.

Building a SMS counting app for windows phone os

Folks,I am planning to build an app to count the number of sms's sent by an user over a period of time.But I am not sure if WP OS SDK gives access to the depth of writing such an app.I am still very new to mobile development,and as Microsoft has limited the access to some API's (ex:language) in the windows phone OS,I was not sure if I can do so.
On the contrary the application I want to build is kind of a basic feature that is in built in many basic phones.I need to get a start for app building,and may also come in handy on my personal phone! ;)Anyone who has come across working on any related feature might help me with his experience.Thank you for your time.
The Windows Phone SDK does not allow developers to access the content of SMS messsages for privacy reasons (or count of those, for that matter).
Your best (and only) bet at the moment is let the user use SmsComposeTask and count the number of messages potentially sent from your app.

Providing web services through XCode

All,
I'm writing an extensive iPad application with a Core Data based data model. Because the app requires a lot of user input / typing, I would also want to make the functionality available as a web page, so that users can use standard PCs to key in some of the data.
I'm not particularly worried about the UI for that web app, but I do want to re-use the application logic and Core Data model that I'm using for the iOS app, so my preferred approach would be to expose the functionality as web services on a Mac (using the built-in Apache web server, most likely), using XCode for MacOS.
(1) Are there any existing XCode-based frameworks that simplify the generation of web services?
(2) Am I missing something obvious i.e. is there a better approach to tackle the problem "exposing iOS functionality through a web environment"? Obviously, I could've immediately focused on writing the app in HTML5, but I did want to leverage all the goodies that come with iOS/Cocoa.
(3) Alternatively, I could write a native Mac OS app. That facilitates the re-use of Core Data, etc., but I heard it takes a lot of work to port iOS apps to Mac OS. The question then is what's more work - exposing the functionality as web services or porting it to Mac OS... in both cases, I would need to rewrite the UI.
thanks everyone,
Fabian
If you want iPhone/iPad users to be able to access the App through the PC web browser to send data/files to the App then take a look # this one:
http://blogs.oreilly.com/iphone/2008/09/creating-an-iphone-based-web-s.html
Check this question too:
https://apple.stackexchange.com/questions/9012/has-anyone-ever-tried-to-use-an-iphone-as-web-server
I did some more research and came across the WebAppKit framework. It allows you to easily set up a web server capability and handle requests and responses. It's lightweight, easy to understand - exactly what I wanted.

Running a Windows Phone 7 app on the desktop

I have an application for Windows Phone 7 that I need to bundle up and send to several doctors for a content review. Ideas on how this might be done? I can't expect the docs to install the full SDK, but if I could bundle the emulator with it that might work, or if there's an easy way to convert the app to a Windows EXE that would as well. All suggestions welcomed!
While the theory is that since it's SIlverlight it should just run on the desktop. Years of Compact Framework development have taught me that this theory is almost never correct and getting it to work is often a real chore.
Microsoft has not yet delivered a stand-along WinPhone emulator (no idea if they will, but they did for WinMo) so for now that option is off the table. Getting your end user to install the stand-alone emulator is a fair bit of work anyway.
To be honest, my experience has been that just doing a Camtasia capture of the developer screen while you step through the app is one of the easiest ways to get ideas across to these types of groups. No, the end result isn't interactive, so they can't clock on buttons themselves, but if you walk through the feature they want to see, you can usually answer 95% of the questions this way.
When you need to address that other 5%, my experience has been that it's easiest to just send them a physical device with the app installed.
If they are (or have ready access to someone who is) fairly tech-savvy, shipping a Virtual PC image of a PC with the emulator installed and the app installed on it sometimes works.
Dot NET code using MS libraries is partially upwards compatible and most runtime classes present on a mobile device are also available on desktop Windows (see MSDN docs for details). So create a copy of your source code, ask visual studio to create a desktop .exe from it, it'll tell you it can't for several reasons, and you will need to recode some sections of it, resize the frame window etc. to make it work.
If one is careful about what methods one uses, I have managed to actually use the exact same .EXE file on the desktop without problems!
You simply cannot present the application without the SDK, since Windows Phone 7 applications rely on a completely different subset of .NET Framework and require an emulator to run XAP packages. Although you might say that it's the same Silverlight, don't forget about Microsoft.Phone and derivatives - you need the SDK in order for those libraries to be properly handled.
Also, you cannot convert a WP7 application to a Windows executable due to difference in platform architectures.
What you could do is simply allow the doctors to test your application through TeamViewer or similar products.
i think a "killer app" for winphone7+silverlight would be a desktop browser based emulator. want to try the app? just have the store run the emulator in the browser. (yeah, lots of technical hurdles, limited multitouch etc, but it would be pretty slick!)

Resources