VB.NET hwnd隐藏状态栏

时间:2015-08-13 15:49:19

标签: vb.net winapi

我需要隐藏外部应用程序上的状态栏。

有人可以解释我如何隐藏" msctls_statusbar32"。

提前谢谢!

1 个答案:

答案 0 :(得分:1)

好的,我找到了一种方法:

<DllImport("user32.dll", SetLastError:=True)> _
   Public Shared Function FindWindowEx(parentHandle As IntPtr, childAfter As IntPtr, className As String, windowTitle As IntPtr) As IntPtr
End Function

<DllImport("user32.dll", SetLastError:=True)> _
Public Shared Function GetWindow(parentHandle As IntPtr, childAfter As IntPtr) As IntPtr
End Function

<DllImport("user32.dll", SetLastError:=True)> _
Public Shared Function ShowWindow(parentHandle As IntPtr, childAfter As IntPtr) As IntPtr
End Function


   Dim statusBarHandle As IntPtr = FindWindowEx(_hwndX, IntPtr.Zero, "msctls_statusbar32", IntPtr.Zero)
   Dim Ichildwind As IntPtr = GetWindow(statusBarHandle, 5)
   ShowWindow(statusBarHandle, Nothing)