We know that under the win7 system, the name of the input method can be obtained through the IME api ImmGetDescription or the registry[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000409 . But the regular code of win10 is invalid. I searched for the need to use the TSF method. I don't know if anyone can help convert to the vb code. Thank you
now
i find
https://docs.microsoft.com/en-us/win...alllayoutortip
https://www.vbforums.com/showthread....ons-by-pointer
used this code ,i can install German input method .
how can i translate
https://docs.microsoft.com/en-us/win...tortipforsetup
Code:
typedef HRESULT (WINAPI *PTF_ INSTALLLAYOUTORTIP)(LPCWSTR psz, DWORD dwFlasg);
HMODULE hInputDLL = LoadLibrary(TEXT("input.dll"));
BOOL bRet = FALSE;
if(hInputDLL == NULL)
{
// Error loading module; fail as securely as possible.
}
else
{
PTF_ INSTALLLAYOUTORTIP pfnInstallLayoutOrTip;
pfnInstallLayoutOrTip = (PTF_ INSTALLLAYOUTORTIP)GetProcAddress(hInputDLL, "InstallLayoutOrTip");
if(pfnInstallLayoutOrTip)
{
bRet = (*pfnInstallLayoutOrTip)(psz, dwFlags);
}
FreeLibrary(hInputDLL);
}
i find
https://docs.microsoft.com/en-us/win...alllayoutortip
https://www.vbforums.com/showthread....ons-by-pointer
Code:
Private Declare Function GetMem4 Lib "msvbvm60" (src As Any, dst As Any) As Long
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
''VB6-Calling-functions-by-pointer by the trick
Public Sub Main()
Dim hUser As Long, hGDI As Long
Dim DC As Long
hUser = LoadLibrary("C:\Windows\System32\input.dll")
PatchFunc "InstallLayoutOrTip", AddressOf InstallLayoutOrTip
InstallLayoutOrTip GetProcAddress(hUser, "InstallLayoutOrTip"), "0x0407:0x00000407", &H2 '
End Sub
Private Function InstallLayoutOrTip(ByVal Addr As Long, ByVal hwnd As String, ByVal hdc As Long) As Long
End Function
how can i translate
https://docs.microsoft.com/en-us/win...tortipforsetup
Code:
EnumLayoutOrTipForSetup