|
-
Mar 21st, 2000, 04:28 PM
#1
Thread Starter
Hyperactive Member
I need to show & hide the browser(IE) from my Vb application. the code I used was
'Declarations(in the form)
---------------------------
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Private Const GW_HWNDNEXT = 2
Private Const GW_OWNER = 4
Private Const GW_HWNDFIRST = 0
Private Sub Command1_Click()
Dim s As String
Dim WinT As String
Dim hwnd As Long
Dim Mybuffer As String
Dim a As Long
Dim TxtLength As Long
hwnd = GetWindow(Form1.hwnd, GW_HWNDFIRST)
While hwnd <> 0
TxtLength = GetWindowTextLength(hwnd)
WinT = Space(TxtLength)
a = GetWindowText(hwnd, WinT, TxtLength)
If (IsWindowVisible(hwnd)) And (GetWindowhwnd, GW_OWNER) = 0) Then
If (InStr("Explorer", WinT) > 0) Then
a = ShowWindow(hwnd, sw_show)
End If
End If
hwnd = GetWindow(hwnd, GW_HWNDNEXT)
Wend
End Sub
but this didnt work...can anyone help me out here?
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|