Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > VB.NET > Windows Forms

Windows Forms Discussion related to Winforms application development

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-02-2010, 3:42 PM
VB.NET Forum Newbie
.NET Framework: .NET 3.5
 
Join Date: Feb 2010
Posts: 2
Reputation: 0
Plantjen is on a distinguished programming path ahead
Question Open link in opened tab

Hello guys,
I have multiple tabs opened in 'any browser' and one of it is titled 'LAME', how can i make links open(by buttons) in that tab?

I have a simple form with two buttons,

Button one:
Code:
 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Process.Start("http://www.google.nl/sub1")
    End Sub
Button two:
Code:
 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Process.Start("http://www.google.nl/sub2")
    End Sub
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-02-2010, 7:41 PM
VB.NET Forum Newbie
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Mar 2009
Location: NY
Posts: 8
Reputation: 0
shady14u is on a distinguished programming path ahead
Default

You can access the tab by getting the window handle of the tab the following console app will give you an idea on how to get the handle for the tab you are looking for

Code:
Module Module1
   
    Private Declare Function FindWindowEx Lib "user32" _
    Alias "FindWindowExA" (ByVal parentHandle As IntPtr, _
    ByVal childAfter As IntPtr, _
    ByVal lclassName As String, _
    ByVal windowTitle As String) As IntPtr

    Public Declare Function GetWindowText Lib "user32" _
   Alias "GetWindowTextA" _
  (ByVal hwnd As Long, _
   ByVal lpString As String, _
   ByVal cch As Long) As Long

    Public Declare Function GetClassName Lib "user32" _
   Alias "GetClassNameA" _
  (ByVal hwnd As Long, _
   ByVal lpClassName As String, _
   ByVal nMaxCount As Long) As Long


    Sub Main()
        
        Dim Parent As Long
        Dim LastWindowFound As Long
        Parent = 0 '0 is the desktop, which is parent to top-lev. LastWindowFound = 0 
        Dim hWin As System.IntPtr
        Dim sWindowText As String = String.Empty
        Dim r As Long = 0L
        Dim sClassname As String = String.Empty
        Console.WriteLine("Window Text for Window || Window Class || Window Handle")

        Do
            hWin = FindWindowEx(Parent, LastWindowFound, "IEFrame", vbNullString)
            If hWin <> 0 Then
                'Get the window text and class name
                sWindowText = Space$(255)
                r = GetWindowText(hWin, sWindowText, 255)
                sWindowText = Left(sWindowText, r)

                sClassname = Space$(255)
                r = GetClassName(hWin, sClassname, 255)
                sClassname = Left(sClassname, r)
                Console.WriteLine(sWindowText + vbTab + " || " + sClassname + vbTab + " || " + hWin.ToString)
            End If
            LastWindowFound = hWin
        Loop Until hWin = 0

        Console.ReadKey()

    End Sub

End Module
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-03-2010, 2:42 AM
VB.NET Forum Newbie
.NET Framework: .NET 3.5
 
Join Date: Feb 2010
Posts: 2
Reputation: 0
Plantjen is on a distinguished programming path ahead
Default

Thanks a lot for helping me, but i'm still pretty new to vb, so how can i use this?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
browse tab


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 6:10 PM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.