Windows 8 metro style apps and window hooks - hook

I am new to both window hooks and Windows 8 metro apps..
I would like to develop a background service/process that:
Checks the "properties" of the metro app that a user just tapped to start (e.g. app that plays music, text document creator app, ...)
Based on the properties found, activate other applications (i.e., before starting the text creator application that the user just tapped, make him select the font face from a popup list)
I am planning on using window hooks to do 1 and 2..
Is this possible?
Thanks!

It is not possible to hook Windows or intercept the launching of a Metro style app from within a Metro style app itself. While it may be possible to do so with a service installed on the machine in a classic way, doing so would be totally undocumented and unsupported. You would have to reverse-engineer the app launching process to have any chance at making it work.

Check this out..
http://social.msdn.microsoft.com/Forums/en/wcf/thread/43df6c8f-f1e3-4aba-af0a-7c4e1db477b6
You can only write client applications using Metro, not server applications.
In your scenario, if you want inter-app communication, recommended way is to use 'Contracts' which are explicitly started by the user.
I'm taking a blind guess here using your 1 and 2 points. Do you intend to handle a specific file type ? say .txt or .wmv ?
If this is your intention, please check here http://tozon.info/blog/post/2011/10/11/Windows-8-Metro-declarations-File-Type-Associations.aspx
There's also a good set of MSDN documentation about this.

You may use API hooking. Check this thread:
http://forum.nektra.com/forum/viewtopic.php?f=9&t=6228

Related

How do I setup a single application for cross platform deployment using MRTK?

I am trying to build an application (converting rather), that builds into a server (UNET/ Mirror wise), a windows client, Oculus Go client and UWP client. More platforms will be implemented in the future.
Unless I did not tackle this the right way, the Toolkit does not seem to be capable of doing this with just one profile, or maybe not at all.
E.g.: I need the mouse for Windows and motion controllers for UWP. Having both in the MixedRealityInputSystemProfile spawns both on UWP. If I don't add the mouse I have nothing on Windows Standalone. This leads me to the conclusion that I have to create multiple profiles. But the MixedRealityToolkit only references a single one. Does that mean I have to additively load a different Toolkit with it's configuration for any platform configuration I want?
The DefaultMixedRealityInputSystemProfile already contains a lot of inputs, which makes me think it should be capable of doing that, but it looks like it does so to a certain degree and then fails.
Thinking further about this:
What if I want an UWP app, but for MR Portal only, or for UWP Standalone only. What about Oculus Go (Android) and Android mobile? The differentiation would be using the Oculus SDK under Android. Using it under windows would result in the Rift being used I guess.
Where do I branch off what?
I believe you can specify which input providers you want on different platforms. For example, if you want a MouseProvider in Windows only, the you can specify the Mouse Input Data Provider to run only on Windows via the “supported platforms” field of the mouse data provider.
Similarly you can enable the motion controllers using same technique.
While there are not yet ways to specify completely different configurations for different platforms, it is possible to solve your specific case of input by configuring the input data providers.

Xamarin.Forms or Xamarin.Android/Xamarin.IOS

I am new to Xamarin and not sure if chose Xamarin.Forms to create a application for ios and android platform has a problem or not.
The application has some features below:
The application will be able to running some code in background without launching application by user.
The application can be launched by a href link or a notification.
The application is able to launch a builtin Camera application, and receive picture data from Camera application.
Thanks,
Bo
The features you are mentioning can be done with both. Actually, anything you can do on Xamarin.iOS and Xamarin.Android can be done with Forms. Because Forms is only an abstraction layer for the UI which is installed by a NuGet package.
Now, having that said when to use Forms or when to use iOS/Android? It is mostly about UI. Are you going to do some advanced or platform specific stuff is is easier to implement that with the platform specific project.
If you UI will be the same in both platforms and mostly consists of some lists and input fields, then that is a very good candidate for a Forms project.
Notice how I said it is easier to do in the platform specific projects. Again here, you can do anything in Forms as well by the means of Custom Renderers, it is just a bit harder to do.
Ideally try it out yourself and see what suits you best.
In regard with your need to execute code in the background. This will be tricky and is very dependent on the platform that you're on. You will definitely have to write platform specific code for that for which you can use the DependencyService to abstract it to your shared code.
However like AlancLui mentioned executing code in the background isn't something that is easy to do on mobile. On iOS it is restricted to accessing location data or playing music, but still your app needs to be running (in the background). Android has something called Services for this, which makes it a bit easier.

WinJs background application

I am working on creating a Windows 10 Universal app. My goal is to have the app run in the background and periodically display a status notification to the user.
I've seen a few articles that talk about creating a background task within the app (https://msdn.microsoft.com/en-us/windows/uwp/launch-resume/run-a-background-task-on-a-timer-), is this the best design pattern I can follow? I'm fairly new to Windows Universal apps and any recommendations on how to do this would be appreciated.
Look at the IBackgroundTask docs. In addition, you can easily implement notifications via the OS with Adaptive Toasts
Since the story around notifications can get complex depending on how you want to control UX, don't be afraid to research building an RT component if you can't find a UWP API that meets your needs. For instance, you can package an RT component with your UWP app that calls into native C++ libraries or more low-level Windows APIs to curate the notification experience for your user.

Windows 10 universal app cross app communication availability

I am an WPF developer with little knowledge for the way "mobile" apps work but in general I believe that they work in some sort of sandbox way (meaning they should not be able to access each others process, info etc., I might be totally incorrect on this one). So I am wondering if such "limitations" are applied to the Universal Windows Platform (UWP) apps?
The reasoning for my question is that I would like to write and app that checks if another Universal App is in process and use some of its information. In WPF there are ways of doing just that but in UWP apps I am not sure if it is/should/will be possible.
Thanks.
There are a couple of solutions in Windows 10. Firstly, if you are building an enterprise app and can also side-load normal Desktop apps, you can use this technique to build your UI as a UWP but also be able to break out of the sandbox and do other things on the desktop.
Secondly, if the app you want to read from is cooperative (ie, is designed to provide information; you're not just grabbing it without permission) then you can use App to App services to send and receive information between two consenting applications.
Both links are to //build videos but you can download the slides too that should contain code samples.

Qt 4.8.4 QWS Server Programmatically Set Focus With Multiple Client Apps

I understand ( How does windowing work in qt embedded? ) that you should run one Application as the QWS Server to provide window management facilities, but that you can run other Apps with graphical interfaces as well in Qt Embedded for Linux.
I want to programmatically switch focus between windows without requiring mouse / keyboard interaction to achieve focus. I've searched the following docs but am not seeing any way to make a different window 'active':
http://qt-project.org/doc/qt-4.8/qwsserver.html
http://qt-project.org/doc/qt-4.8/qapplication.html
http://qt-project.org/doc/qt-4.8/qsessionmanager.html#details
http://qt-project.org/doc/qt-4.8/qwswindow.html
QWSServer has a method:
const QList<QWSWindow *> & QWSServer::clientWindows ()
Which returns a list of QWSWindows, but I don't see how I can make one of those windows the currently active window. How can I do this? Thanks -
The accepted answer is false in some sense. I think solution is to find needed window by clientWindows, then call QWSWindow::setActiveWindow() and then QWSWindow::raise().
QWSWindow provides the undocumented raise() method. See: qwindowsystem_qws.h definition of QWSWindow. You need this type of functionality if you want to make any sort of window manager.
Undocumented can beat impossible in some situations.
It is even more complex and difficult, if you wish to let non-Qt applications have focus, etc.
If you are trying to do it using QWSServer::clientWindows (), then forget about it. QWSWindow and QWSClient are just providing interfaces to get information about client windows. You can not control them from the server application.
There are two ways to do what you want :
do it from the application creating the window
embed the client windows using QWSEmbedWidget, and then you get some kind of control

Resources