Option Explicit
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
Dim hEdit As Long ' Combo中的Edit的窗口句柄
Private Sub Command1_Click()
' 0--2
ShowWindow hEdit, 0
End Sub
Private Sub Command2_Click()
' 2--0
ShowWindow hEdit, 5
End Sub
Private Sub Form_Load()
hEdit = FindWindowEx(Combo1.hwnd, 0&, "Edit", vbNullString) ' 获得窗口句柄
End Sub
Option Explicit
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 DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Sub Command1_Click()
Dim hEdit As Long ' Combo中的Edit的窗口句柄
hEdit = FindWindowEx(Combo1.hwnd, 0&, "Edit", vbNullString) ' 获得窗口句柄
DestroyWindow hEdit
End Sub