|    | 
     Excel上に配置したコマンドボタンを押して別ウィンドゥ(アプリケーション)の 
IMEを無条件にオフにしたいと思い、ネット上のVBAサンプルプログラムを 
見よう見まねで記述したのですが、期待どおりに動きません。 
どこが悪いのか、ご存知の方がいたらご指摘いただけないでしょうか? 
Excel2000を使用しています。 
私が記述したVBAは以下のとおりです。 
*************************************************************************** 
Private Declare Function GetForegroundWindow Lib "user32" () As Long 
Private Declare Function GetNextWindow Lib "user32" Alias "GetWindow" (ByVal hWnd As Long, ByVal wFlag As Long) As Long 
Private Declare Function ImmSetOpenStatus Lib "imm32.dll" (ByVal himc As Long, ByVal b As Long) As Long 
 
Private Sub Command1_Click() 
  Dim himc As Long 
  Dim myhWnd As Long 
   
  myhWnd = GetForegroundWindow() 
  myhWnd = GetNextWindow(myhWnd, 2) 
   
  Application.WindowState = xlMinimized 
 
  Call ImmSetOpenStatus(myhWnd, False) 
  Application.WindowState = xlMinimized 
 
End Sub 
*************************************************************************** 
 
よろしくお願いします 
。 
 
 | 
     
    
   |