Windows Task View using Code

email me

One of the great new features in Windows 10 is the Task View. Using Windows-key + Tab, all the windows will appear on screen in their smaller forms. This gives you the ability to select which window you would like to focus on quickly. This code shows you how to simulate the hotkeys…thus allowing you to add the Task View option to your own scripts and apps.

This was done in VS 2015, C#, and as a console app

// I changed console output from Console to Application - to hide the window

//Run this command from the Package Manager Console:
//Install-Package InputSimulator
using WindowsInput.Native;

namespace taskview
{
class Program
{
static void Main(string[] args)
{
WindowsInput.InputSimulator kb = new WindowsInput.InputSimulator();
kb.Keyboard.ModifiedKeyStroke(VirtualKeyCode.LWIN, VirtualKeyCode.TAB);
}
}
}