2015-08-13 208 views
-1

我需要隱藏外部應用程序的狀態欄。VB.NET hwnd隱藏狀態欄

有人可以解釋我如何隱藏「msctls_statusbar32」。

預先感謝您!

回答

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)