Results 1 to 17 of 17

Thread: Have a quick question I'm sure Bloodeye knows...

  1. #1

    Thread Starter
    Hyperactive Member AAG's Avatar
    Join Date
    Aug 2000
    Location
    United States
    Posts
    411

    Have a quick question I'm sure Bloodeye knows...

    How would I go about getting the link that was right clicked or left clicked on in a webbrowser control ?? I simply want to know so that I can create my own open in new window functions and stuff...

    Thanx

    AAG
    This Business Is Binary. Your a 1 or a 0. Alive or Dead. (AntiTrust)

  2. #2
    Matthew Gates
    Guest
    Try this:


    VB Code:
    1. Private Sub webbrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
    2.     Dim NewFrm As New Form1
    3.     NewFrm.Show
    4.     Set ppDisp = NewFrm.webbrowser1.object
    5. End Sub

  3. #3

    Thread Starter
    Hyperactive Member AAG's Avatar
    Join Date
    Aug 2000
    Location
    United States
    Posts
    411
    hehe nah man thats not what i needed, I already know how to do that. I know quite a bit about the webbrowser control, so don't think i'm a beginner. Let me try and explain what i need to do. I have created a mousehook and trap the WM_RBUTTONUP message when the mouse is over the Webbrowser control, I cancel the original popup of IE, then I replace it with my own popup with special functions I have created. One of my functions is "Open In New Window", but I don't know how to get the url of the link that was right clicked on. I need this url so that i can Load a new instance of the webbrowser control and navigate to it. my problem is not that of creating a new window, its getting the url of the link. I cannot use the Status Text of the webbrowser control because some websites contain scolling text in the status and what not that will prevent the actual URL from being shown. I hope this has cleared things up....

    Thanx for the reply though man, I appreciate it

    AAG
    This Business Is Binary. Your a 1 or a 0. Alive or Dead. (AntiTrust)

  4. #4
    DaoK
    Guest
    so don't think i'm a beginner.
    lol ... I dont think he think that...

  5. #5

    Thread Starter
    Hyperactive Member AAG's Avatar
    Join Date
    Aug 2000
    Location
    United States
    Posts
    411
    hehe yea myabe not, but it never hurts to add that so that they don't waste thier time explaining things....
    This Business Is Binary. Your a 1 or a 0. Alive or Dead. (AntiTrust)

  6. #6
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390
    why cant you capture the URL on the before nav to?
    or is your canceling killing it before this event?
    I know there is another way but its been months since I've been playing with VB (busy at work learning Perl)


    No VB here either so I can even try....
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  7. #7

    Thread Starter
    Hyperactive Member AAG's Avatar
    Join Date
    Aug 2000
    Location
    United States
    Posts
    411
    yea the Canceling of the New_Window2 event kills the before navigate event.... I've tried tons of different things and still nothing has proven to work. On some sites simply grabbing the status text works but as i've said before, alot of sites use the scrolling status so....
    This Business Is Binary. Your a 1 or a 0. Alive or Dead. (AntiTrust)

  8. #8
    AutoBot
    Guest

    Uhmmm

    Maybe if you could try to add a hot key to the event, instead of right click and your menu you could maybe have the user hold Alt + LeftClick and have the link open in a new window. I'm sure that doesn't help you with your dilemma but of course I don't know anything about the web browser control your trying to use either. Try emailing Megatron your problem, I'm sure he knows the answer but maybe hasn't seen your post.

  9. #9

    Thread Starter
    Hyperactive Member AAG's Avatar
    Join Date
    Aug 2000
    Location
    United States
    Posts
    411
    I already have a key assigned to open a new window. If you ctrl+click it will allow the popup i wouild like the option in the menu also
    This Business Is Binary. Your a 1 or a 0. Alive or Dead. (AntiTrust)

  10. #10
    Frenzied Member Skitchen8's Avatar
    Join Date
    Feb 2001
    Location
    Binghamotn, NY
    Posts
    1,943
    Originally posted by AAG
    yea the Canceling of the New_Window2 event kills the before navigate event.... I've tried tons of different things and still nothing has proven to work. On some sites simply grabbing the status text works but as i've said before, alot of sites use the scrolling status so....
    is it possible to cancel the event after the before navigate has been called?
    Government is another way to say better…than…you.
    It’s like ice but no pick, a murder charge that won’t stick,
    it’s like a whole other world where you can smell the food,
    but you can’t touch the silverware.
    Huh, what luck. Fascism you can vote for.
    Humph, isn’t that sweet?
    And we’re all gonna die some day, because that’s the American way
    -Stone Sour

  11. #11
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Here's a dodgy way to do it.
    Right, you have the source code to the webpage. You can also get the mouse co-ordinates.

    So you could figure out where, physically on the page, each of the links are. Then when the user clicks, just go through an array of regions on the screen. If the user is inside one of those regions, they're on a link, and you would know which one it was...



    Either that, or are you able to get the text of the link ?
    If so then you could compare that to the HTML source and figure out which link it was.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  12. #12
    Frenzied Member Skitchen8's Avatar
    Join Date
    Feb 2001
    Location
    Binghamotn, NY
    Posts
    1,943
    yeah, but that would be terribly hard to do
    Government is another way to say better…than…you.
    It’s like ice but no pick, a murder charge that won’t stick,
    it’s like a whole other world where you can smell the food,
    but you can’t touch the silverware.
    Huh, what luck. Fascism you can vote for.
    Humph, isn’t that sweet?
    And we’re all gonna die some day, because that’s the American way
    -Stone Sour

  13. #13
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Well who ever said this job was easy
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  14. #14
    Frenzied Member Skitchen8's Avatar
    Join Date
    Feb 2001
    Location
    Binghamotn, NY
    Posts
    1,943
    its gotta be easier than that... besides you would have to account for the fact that most people code "short Adresses" so you would have to add the website name that you are at now, and then put the link address after that if you used your second idea.
    Government is another way to say better…than…you.
    It’s like ice but no pick, a murder charge that won’t stick,
    it’s like a whole other world where you can smell the food,
    but you can’t touch the silverware.
    Huh, what luck. Fascism you can vote for.
    Humph, isn’t that sweet?
    And we’re all gonna die some day, because that’s the American way
    -Stone Sour

  15. #15

    Thread Starter
    Hyperactive Member AAG's Avatar
    Join Date
    Aug 2000
    Location
    United States
    Posts
    411
    yea, believe me, i've thought about and tried all of those ideas... nothing seems to work, i didnt' try to whole getcursorpos and what not, that just seems way to crappy. hhee
    This Business Is Binary. Your a 1 or a 0. Alive or Dead. (AntiTrust)

  16. #16
    Frenzied Member Skitchen8's Avatar
    Join Date
    Feb 2001
    Location
    Binghamotn, NY
    Posts
    1,943
    the only idea i have is to let it open IE, grab the address, kill the process, and open a new form
    Government is another way to say better…than…you.
    It’s like ice but no pick, a murder charge that won’t stick,
    it’s like a whole other world where you can smell the food,
    but you can’t touch the silverware.
    Huh, what luck. Fascism you can vote for.
    Humph, isn’t that sweet?
    And we’re all gonna die some day, because that’s the American way
    -Stone Sour

  17. #17

    Thread Starter
    Hyperactive Member AAG's Avatar
    Join Date
    Aug 2000
    Location
    United States
    Posts
    411
    but that way is so inefficient... i know there has to be a simple way... i wonder where bloodeye is, i guess i'll email him..
    This Business Is Binary. Your a 1 or a 0. Alive or Dead. (AntiTrust)

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