IMEのファイル名を取得          <TOP>


IMEのファイル名を取得します。

GetKeyboardLayout キーボードレイアウトのハンドルを取得

ImmGetIMEFileName IMEのファイル名を取得する関数の宣言

 

例:Valuestar:WindowsXP             Flora:Windows2000                   Flora:Windows98         

  

 

'================================================================
'= IMEファイル名を取得
'=    (ImmGetIMEFileName.bas)
'================================================================
#include "Windows.bi"

' キーボードレイアウトのハンドルを取得
Declare Function Api_GetKeyboardLayout& Lib "user32" Alias "GetKeyboardLayout" (ByVal dwLayout&)

' IMEのファイル名を取得する関数の宣言
Declare Function Api_ImmGetIMEFileName& Lib "imm32" Alias "ImmGetIMEFileNameA" (ByVal hKL&, ByVal lpszFileName$, ByVal uBufLen&)

Var Shared Text(1) As Object
Var Shared Button1 As Object

For i = 0 To 1
    Text(i).Attach GetDlgItem("Text" & Trim$(Str$(i + 1)))
    Text(i).SetFontSize 14
Next 
Button1.Attach GetDlgItem("Button1") : Button1.SetFontSize 14

'================================================================
'=
'================================================================
Declare Sub Button1_on edecl ()
Sub Button1_on()
    Var KeybdhWnd As Long
    Var ImeFileName As String * 128
    Var Ret As Long

    KeybdhWnd = Api_GetKeyBoardLayout(0)
    Ret = Api_ImmGetIMEFileName(KeybdhWnd, ImeFileName, Len(ImeFileName))

    Text(1).SetWindowText Left$(ImeFileName, InStr(ImeFileName, Chr$(0)) - 1)
End Sub

'================================================================
'=
'================================================================
While 1
    WaitEvent
Wend
Stop
End