Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 14961

How to get the input method name on win10 computer

$
0
0
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

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);
}

now
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

used this code ,i can install German input method .

how can i translate

https://docs.microsoft.com/en-us/win...tortipforsetup

Code:

EnumLayoutOrTipForSetup

Viewing all articles
Browse latest Browse all 14961

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>