| View previous topic :: View next topic |
| Author |
Message |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Wed Jan 19, 2005 3:02 am Post subject: Capturing URL and Title from Browsers - Need help |
|
|
Ok, I found a way to capture the URL and Title of an opened window of IE or FireFox.. Now that works using DDE, but someone would have an idea on how to make this work for multiple IE/FireFox opened windows and when new ones appear?
Here is what I have so far:
| Code: | DIALOG CREATE,GetUrl,-1,0,0,0,NOTITLE
dialog show
# Get IE URL and Title
DDE LINK,IExplore,WWW_GetWindowInfo
if @not(@OK())
warn Unable to establish DDE link@CR()with IE
exit
end
%%rq = "0xFFFFFFFF,sURL,sTitle"
%%info = @ddeitem(%%rq)
info %%info
DDE TERMINATE
#Get Firefox URL and Title
DDE LINK,FireFox,WWW_GetWindowInfo
if @not(@OK())
warn Unable to establish DDE link@CR()with Firefox
exit
end
%%rq = "0xFFFFFFFF,sURL,sTitle"
%%info = @ddeitem(%%rq)
info %%info
DDE TERMINATE
exit |
Thanks...  |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Wed Jan 19, 2005 8:07 am Post subject: |
|
|
i have written a program that keeps track of the title bar of msie, opera, netscape and firefox
the way i do it is to keep track of all the windows opened and see if the title bar contains the keyword relevant for each browser
if it does then i keep track of that particular window using its identifier which is in the form of %23454
same thing with tabs - when a user changes tabs, the title bar changes and this is recorded
i am not as fancy as you as i used the trusted command @WINACTIVE as it gives me the window identifier and title bar
hope this helps
serge _________________
|
|
| Back to top |
|
 |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Wed Jan 19, 2005 2:12 pm Post subject: |
|
|
Thanks Serge, good suggestions  |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Wed Jan 19, 2005 2:19 pm Post subject: |
|
|
 _________________
|
|
| Back to top |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Wed Jan 19, 2005 3:39 pm Post subject: |
|
|
Awesome information, Marty! Thanks so much for posting this.
Just an FYI... Your code also works with Opera and Netscape using the following:
[Opera 7.54]. Tested; works:
| Code: | | DDE LINK,Opera,WWW_GetWindowInfo |
Not sure about previous versions of Opera, but probably works.
[Netscape 6] - Tested; works:
| Code: | | DDE LINK,Netscape6,WWW_GetWindowInfo |
[Earlier versions of Netscape?] - Have not tested... I think Netscape 6 uses different conventions than previous versions, but the following probably works for earlier versions:
| Code: | | DDE LINK,Netscape,WWW_GetWindowInfo |
Finally, you may want to check out the following page for some useful tidbits:
http://www.angelfire.com/biz/rhaminisys/ddeapps.html
From the aforementioned page (regarding IE):
Multible Browser Instances - Each instance of Internet Explorer registers itself as a DDE server. To distinguish between them a client using DDEML can connect with the instance specific service name handle. If this is not done, it is pot luck which instance will establish a conversation with a client. If you open a file by double clicking it you cannot control which instance of IE will open it. Instance specific handles are transient and cannot be held in the Registry.
Cheers,
- Boo |
|
| Back to top |
|
 |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Thu Jan 20, 2005 3:42 am Post subject: |
|
|
Thanks Boo And happy to hear you like this tip  |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|