This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes How to get URL information Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to get URL information" Watch "How to get URL information" New topic
Author

How to get URL information

Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
I have a standalone java application that is not running inside a browser. Is there a way to get the current URL displayed inside the address field
of Internet Explorer?
Thanks.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
First you would have to get your application to find out of IE is even RUNNING . . . Suddenly this gets very OS dependant.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Barry Brashear
Ranch Hand

Joined: Jun 05, 2001
Posts: 303
Let's assume that IE si the browser that will be used. Is there a way to get this information?
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
I seriously doubt if you are going to get this done using Java. What you need to do is go to the Windows OS (I am making the assumption that you meant this OS) and find out what processes are running. Then you have to find out which of those processes is handling IE (note that there may be more than one running at a time). Then you need to find out what page it is looking at.
Essentially this is what the TaskManager in Windows does, so you would need to find the MicroSoft dll that does this and use some JNI to integrate those functions into your java app.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
I was reading this other thread on Proxy Servers, and they were talking about: if you know the port that the browser will connect to you can listen for connections and parse the HTTP Headers etc.
Proxy Servers
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to get URL information
 
Similar Threads
netbeans in Java (is there good books explain GUI in netBeans in details with examples)
location of xsd file
Passed With 141/155 (~91%)
Add Image on to JFrame in jar file
how to specify the path for DocumentBuilder.parse