|
-
Jun 8th, 2002, 06:03 AM
#1
Thread Starter
Lively Member
Bring a window to top??
How do i bring a window (e.g from IE) to the top? I tried it like this
Code:
windowhandle = FindWindow(vbNullString, "Mywebsite - Microsoft Internet Explorer")
If windowhandle <> 0 Then
BringWindowToTop windowhandle
DoEvents
SetForegroundWindow windowhandle
End If
but it does not work properly. Sometimes the window comes to top, the other time the window is blinking in the taskbar, but it remains in background.
-
Jun 8th, 2002, 06:22 AM
#2
Frenzied Member
Did you try the inhernet Appactivate method?
VB Code:
strTitle = "VB Q and A - General VB Questions - Microsoft Internet Explorer"
AppActivate strTitle
"Brothers, you asked for it."
...Francisco Domingo Carlos Andres Sebastian D'Anconia
-
Jun 8th, 2002, 06:32 AM
#3
Thread Starter
Lively Member
Yes, didn't work either..
-
Jun 8th, 2002, 06:37 AM
#4
Frenzied Member
try this instead
VB Code:
Private Declare Function BringWindowToTop Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub Command1_Click()
strtitle = "VB Q and A - General VB Questions - Microsoft Internet Explorer"
ret = FindWindow(vbNullString, strtitle)
BringWindowToTop ret
End Sub
"Brothers, you asked for it."
...Francisco Domingo Carlos Andres Sebastian D'Anconia
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
|