Pelles C forum

Pelles C => Add-ins => Topic started by: TimoVJL on September 29, 2015, 03:31:08 PM

Title: OnScreenKeyboard Add-In
Post by: TimoVJL on September 29, 2015, 03:31:08 PM
OnScreenKeyboard Add-In run osk.exe from system folder. Nothing else.

Tablet PC Input Panel (TabTip.exe) test:
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <shellapi.h>
#include <shfolder.h>

#pragma comment(lib, "shell32.lib")
/*
CommonProgramFiles=C:\Program Files (x86)\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe
C:\Program Files (x86)\Common Files\Microsoft Shared\ink\TabTip32.exe
*/
void __cdecl WinMainCRTStartup(void)
{
TCHAR szPath[MAX_PATH];

int iLen, iLen2;
iLen2 = GetEnvironmentVariable("CommonProgramFiles(x86)", szPath, sizeof(szPath));
if (iLen2)
iLen = GetEnvironmentVariable("CommonProgramW6432", szPath, sizeof(szPath));
else
iLen = GetEnvironmentVariable("CommonProgramFiles", szPath, sizeof(szPath));
lstrcat(&szPath[iLen], "\\Microsoft Shared\\ink\\TabTip.exe");
OutputDebugString(szPath);
iLen = (int)ShellExecute(0,TEXT("open"),szPath, NULL, NULL, SW_SHOWNORMAL);
if (iLen <= 32)
MessageBox(0,TEXT("TabTip not found"),0,MB_OK);
ExitProcess(0);
}