|
-
Sep 14th, 2001, 09:53 AM
#1
Thread Starter
Hyperactive Member
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)
-
Sep 14th, 2001, 02:01 PM
#2
Try this:
VB Code:
Private Sub webbrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
Dim NewFrm As New Form1
NewFrm.Show
Set ppDisp = NewFrm.webbrowser1.object
End Sub
-
Sep 14th, 2001, 02:58 PM
#3
Thread Starter
Hyperactive Member
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)
-
Sep 14th, 2001, 03:30 PM
#4
so don't think i'm a beginner.
lol ... I dont think he think that...
-
Sep 14th, 2001, 03:35 PM
#5
Thread Starter
Hyperactive Member
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)
-
Sep 14th, 2001, 03:43 PM
#6
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"
-
Sep 14th, 2001, 05:27 PM
#7
Thread Starter
Hyperactive Member
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)
-
Sep 15th, 2001, 01:11 AM
#8
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.
-
Sep 15th, 2001, 08:40 AM
#9
Thread Starter
Hyperactive Member
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)
-
Sep 15th, 2001, 08:55 AM
#10
Frenzied Member
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
-
Sep 15th, 2001, 09:01 AM
#11
Retired VBF Adm1nistrator
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]
-
Sep 15th, 2001, 09:04 AM
#12
Frenzied Member
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
-
Sep 15th, 2001, 09:07 AM
#13
Retired VBF Adm1nistrator
Well who ever said this job was easy
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Sep 15th, 2001, 09:10 AM
#14
Frenzied Member
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
-
Sep 15th, 2001, 10:20 AM
#15
Thread Starter
Hyperactive Member
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)
-
Sep 15th, 2001, 12:59 PM
#16
Frenzied Member
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
-
Sep 15th, 2001, 02:39 PM
#17
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|