隐藏其它程序上的控件
代码目的是针对其它程序,隐藏其它程序上的控件,要隐藏的控件位于 tab 容器内,然后在TAB容器内有放了一个Frame2,然后文本控件在frame2内,下面是我的代码,不知道哪里错了,请各位大大帮忙看看,谢谢了。
'以下是代码:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Const WM_SETTEXT = &HC
Private Sub Command1_Click()
Dim h1 As Long
Dim h2 As Long
Dim h3 As Long
Dim h4 As Long
h1 = FindWindow("ThunderFormDC", vbNullString)
h2 = FindWindowEx(h1, 0&, "SSTabCtlWndClass", vbNullString)
h3 = FindWindowEx(h2, 1&, "ThunderFrame", vbNullString)
h4 = FindWindowEx(h3, 2&, "ThunderRT6TextBox", vbNullString)
Text1 = h4
ShowWindow y, SW_HIDE
End Sub