Results 1 to 2 of 2

Thread: 2 Qs- IE & Findwindow API

  1. #1

    Thread Starter
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    Question

    Hi everyone...

    I have the following:

    'API call to Findwindow up here

    Private Sub Command1_Click()
    Dim hwnd As Long ' Receives IE window handle
    Dim retval As Long ' Return value
    Dim MyAppID As String ' Text variable for opening IE

    MyAppID = Shell("C:\path_2_IE_here\IEXPLORE.EXE")

    Do while hwnd <> 0 Then
    MsgBox "Hello!"
    Exit Do
    Loop
    End Sub

    (Haven't worked out how you guys write in colour on this site yet).

    NO 1 - How can I specify in above a site to goto (i.e.- http://www.vbworld.com)?

    NO 2 - Above is a dummy based on what I need to do. I am trying to do a loop so that the msgbox code executes AFTER IE has opened, but with no luck!

    Can anyone help me please? thank you!
    Alex Read

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  2. #2
    Guest
    use the [ code ] [ / code ] tags without the spaces...

    use the ShellExecute API,




    Code:
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    Private Const SW_SHOWNORMAL = 1
    
    
    Public Sub gotoweb(URL As String)
    
      Call ShellExecute(0&, vbNullString, URL, vbNullString, "C:\", SW_SHOWNORMAL)
    
    End Sub
    I took this code from a Vb-world demo program I downloaded....
    (The Lander Game)



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width