Programmatically Launching Windows 10 Emoji Hotkeys

Open Emoji panel in a Windows Forms or WPF application

You need to handle the desired event, then first Focus to your control, then using CoreInputView.GetForCurrentView get the core input view for the current window, and then call its TryShow method and pass CoreInputViewKind.Emoji to the method. For example:

//using Windows.UI.ViewManagement.Core;
private async void button1_Click(object sender, EventArgs e)
{
    textBox1.Focus();
    CoreInputView.GetForCurrentView().TryShow(CoreInputViewKind.Emoji);
}

Note: For Windows Forms or WPF project, before using above code, you need to configure your project to be able to call Windows Runtime APIs in desktop apps.

Call Windows Runtime APIs in Windows Forms or WPF

.NET 5

  1. Solution Explorer → Right click on your project → Choose Edit Project File.

  2. Change the value of TargetFramework to one of the following strings and save changes.

    • net5.0-windows10.0.17763.0: for targeting Windows 10, version 1809.
    • net5.0-windows10.0.18362.0: for targeting Windows 10, version 1903.
    • net5.0-windows10.0.19041.0: for targeting Windows 10, version 2004.

    For example:

    <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
      <PropertyGroup>
        <OutputType>WinExe</OutputType>
        <TargetFramework>net5.0-windows10.0.18362.0</TargetFramework>
        <UseWindowsForms>true</UseWindowsForms>
      </PropertyGroup>
    </Project>
    

.NET 4.X

  1. Tools → NuGet Package Manager → Package Manager Settings → Make sure PackageReference is selected for Default package management format.

  2. Solution Explorer → Right click on your project → choose Manage NuGet Packages.

  3. Find Microsoft.Windows.SDK.Contracts package. In the right pane of the NuGet Package Manager window select the desired version of the package based on the version of Windows 10 you want to target and click install:

    • 10.0.19041.xxxx: for targeting Windows 10, version 2004.
    • 10.0.18362.xxxx: for targeting Windows 10, version 1903.
    • 10.0.17763.xxxx: for targeting Windows 10, version 1809.
    • 10.0.17134.xxxx: for targeting Windows 10, version 1803.