PDA

Click to See Complete Forum and Search --> : Hide


apache77
Nov 21st, 2000, 04:47 AM
How can hide everything application window
by a VB Project???
EX. (Hide Internet Explorer from my form).
Thax!!!

Nov 21st, 2000, 03:05 PM
Use ShowWindow

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

Private Sub Command1_Click()
Dim hApp As Long
hApp = FindWindowEx(0, 0, "IEFrame", vbNullString)
ShowWindow hApp, 0 'change 0 to 1 to show it again
End Sub

Nov 21st, 2000, 03:07 PM
This next example will loop through all windows and hide them.

Code for a Module.

Declare Function EnumWindows Lib "user32.dll" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long

Public Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Long
ShowWindow hwnd, 0
End Function


Code for a Form.

Private Sub Form_Load()
EnumWindows AddressOf EnumWindowsProc, 0
End Sub