Recently I have noticed that Windows 8 Task Manager can be shown in Metro UI.
The requirement is that you must set it always on top (through "Options -> Always on top" menu).
After setting always on top, you can launch Task Manager in Desktop, switch to Metro, you can see that Task Manager is shown in Metro.
Or you can directly launch Task Manager in Metro (by pressing Ctrl+Shift+Esc or Ctrl+Alt+Delete).
I just wanna know how to achieve this in other apps? Other desktop apps don't have this behavior if they are always on top.
Is Windows 8 Task Manager is a special app? Maybe it is a mixture of Desktop app and Metro app? Or there are some hidden Windows API that can achieve this?
The reason why I want to know how to do this is that I want to write a clock gadget that will always shown in Metro (in a corner of the screen). So I don't have to bring up Windows Charm (by pressing Win+C) when I want to know the time.
There is a way to do that by using a manifest file and doing some stuff :)
How ?
Prepare the project:
- Add a manifest file to your UI Project with
level=highestAvailable
anduiAccess=true
- The mainWindow should have the two properties :
ShowInTaskbar
andTopMost
enabled.
- Add a manifest file to your UI Project with
Signing the APP: Build your project. If you try to run the application at this point, it won't work because you need to sign it. See this link for how to do it.
Moving to a trusted location: You need to copy your application in a trusted location:
C:\program files' 'C:\program files x86' or 'C:/Windows/system32
It is not possible for you to write an application that does this. The task manager is an app with special privileges that you cannot give to other applications.
来源:https://stackoverflow.com/questions/12873323/how-to-make-windows-8-desktop-apps-shown-in-metro-ui-like-task-manager