Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Found window, now navigate to frame

Status
Not open for further replies.

jlsmithhartfiel

Programmer
Jan 7, 2002
336
US
Hi!

I have gotten some great code snippets from this forum. What I'm doing is searching for an IE window that has a particular title & bring it to the front. (Intranet app, so title should always be the same) If it's not open, open it.

What I'm looking for now:
Now that I have the window, how can I load in a particular frame on page1.htm?

Code:
Public Sub GetClassNameFromTitle()
    Dim sInput As String, lpClassName As String
    Dim nMaxCount As Long, lresult As Long, Hwnd As Long
    nMaxCount = 256
    lpClassName = Space(nMaxCount)
    sInput = "My Intranet App - Microsoft Internet Explorer"
    Hwnd = FindWindow(vbNullString, sInput)
    If Hwnd = 0 Then
        openIE
    Else
        lresult = GetClassName(Hwnd, lpClassName, nMaxCount)
        SetForegroundWindow Hwnd
        ShowWindow Hwnd, SW_SHOWMAXIMIZED
        'Navigate to frame "mainFrame" in page1.htm????
    End If
End Sub

Public Sub openIE()
    Dim StartDoc As Long
    StartDoc = ShellExecute(Hwnd, "open", "[URL unfurl="true"]http://www.test.com/page1.htm",[/URL] _
                "", "C:\", SW_SHOWMAXIMIZED)
    
End Sub

TIA,
Jessica

Jessica [ponytails2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top