|
▼いったく さん:
たびたびすいませんデバイスコンテキストじゃなくて普通のコンテキストでした
VBですがここが参考になると思われます
ht tp://www.alato.ne.jp/kazu-/vb/tip09.htm
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 Declare Function ImmGetContext Lib "imm32.dll" (ByVal hWnd As Long) As Long
Private Declare Function ImmReleaseContext Lib "imm32.dll" (ByVal hWnd As Long, ByVal himc As Long) As Long
Private Sub Command1_Click()
Dim himc As Long
Dim myhWnd As Long
myhWnd = GetForegroundWindow()
myhWnd = GetNextWindow(myhWnd, 2)
himc = ImmGetContext(myhWnd)
Application.WindowState = xlMinimized
Call ImmSetOpenStatus(himc, False)
Application.WindowState = xlMinimized
'取得したコンテキストハンドルは必ずリリースする
Call ImmReleaseContext(myhWnd, himc)
End Sub
|
|