OK, I reverse engineered what explorer does when the user presses that button in the system tray.
Basically it creates an instance of an undocumented interface
ITipInvocation and calls its
Toggle(HWND) method, passing desktop window as an argument. As the name suggests, the method either shows or hides the keyboard depending on its current state.
Please note that explorer creates an instance of
ITipInvocation on every button click. So I believe the instance should not be cached. I also noticed that explorer never calls
Release() on the obtained instance. I'm not too familiar with COM, but this looks like a bug in explorer.
I tested this in Windows 8.1, Windows 10 & Windows 10 Anniversary Edition and it works perfectly. Here's a minimal example in C that obviously lacks some error checks.
0x4CE576FA, 0x83DC, 0x4f88, 0x95, 0x1C, 0x9D, 0x07, 0x82, 0xB4, 0xE3, 0x76);
0x37c994e7, 0x432b, 0x4834, 0xa2, 0xf7, 0xdc, 0xe1, 0xf1, 0x3b, 0x83, 0x4b);
struct ITipInvocation : IUnknown
virtual HRESULT STDMETHODCALLTYPE Toggle(HWND wnd) = 0;
int WinMain(HINSTANCE hInst, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
hr = CoInitialize(0);
hr = CoCreateInstance(CLSID_UIHostNoLaunch, 0, CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER, IID_ITipInvocation, (void**)&tip);
Here's the C# version as well:
static void Main(string args)
var uiHostNoLaunch = new UIHostNoLaunch();
var tipInvocation = (ITipInvocation)uiHostNoLaunch;
void Toggle(IntPtr hwnd);
[DllImport("user32.dll", SetLastError = false)]
static extern IntPtr GetDesktopWindow();
Update: As per @EugeneK comments, I believe that
tabtip.exe is the COM server for the COM component in question, so if your code gets
REGDB_E_CLASSNOTREG, it should probably run
tabtip.exe and try again.