Ẩn 1 cửa sổ khác đang hoạt động vb

Liên hệ QC
Tôi tuân thủ nội quy khi đăng bài

Vcoder180990

Thành viên mới
Tham gia
20/5/23
Bài viết
3
Được thích
0
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Const SWP_HIDEWINDOW = &H80
Private Const SWP_SHOWWINDOW = &H40

Private Sub Command1_Click()
hwnd1 = FindWindow(vbNullString, "Calculator")
Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
End Sub

Private Sub Command2_Click()
hwnd1 = FindWindow(vbNullString, "Calculator")
Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
End Sub
 
Web KT

Bài viết mới nhất

Back
Top Bottom