| View previous topic :: View next topic |
| Author |
Message |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Sep 01, 2002 2:54 pm Post subject: Get text from an element on another window |
|
|
Is there a way (or API) that can retreive text from another window, e.x. the address from from Internet Explorer? _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Federico VDS Pirate


Joined: 03 Aug 2002 Posts: 8
|
Posted: Sun Sep 01, 2002 2:58 pm Post subject: |
|
|
GetWindowText
SetWindowText |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Sep 01, 2002 3:07 pm Post subject: |
|
|
Thank you. But how would you use them to get the address from #IEFRAME 's combo box? _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Sun Sep 01, 2002 3:11 pm Post subject: |
|
|
Use this:
%z = @sendmsg(@winexists(#IEFRAME),Messagenumber,wparam,lparam) |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Sun Sep 01, 2002 3:13 pm Post subject: |
|
|
I think simply the @wintext() function will do, in conjunction with the appropriate window
identifier. |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Sep 01, 2002 3:22 pm Post subject: |
|
|
If I use %z = @wintext(#IEFRAME) it returns the title of the window. Actually I would be using this in google.com web page translation script so that it can get the address that the user is currently on and return a translated version of the page...
By the way, %z = @wintext(#IEFRAME) should be changed to %z = @wintext(@winactive())...
skit3000's version does the same...gets the window title...but how can I get the URL? _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Sep 01, 2002 3:27 pm Post subject: |
|
|
Maybe this javascript bookmarklet would help...
javascript:URL=self.location.href;prefix=URL.substring(0,URL.indexOf('.')+1);URLremain=URL.substring(prefix.length,URL.length);domain='';if((prefix=='http://www.')||(prefix=='www.')){domain=URLremain.substring(0,URLremain.indexOf('/'));}else{prefix2=URL.substring(0,7);if(prefix2=='http://'){URLremain2=URL.substring(prefix2.length,URL.length);domain=URLremain2.substring(0,URLremain2.indexOf('/'));}else{domain=URL.substring(0,URL.indexOf('/'));}}location.href='http://www.coolwhois.com/?d='+domain; _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Sep 01, 2002 4:45 pm Post subject: |
|
|
Here's a bit of code I wrote to write a link that will translate a ppage with one click...you can have multiple links that translate different languages...
Here is a script to generate the link:
| Code: |
Title .url Generator
OPTION DECIMALSEP,"."
OPTION SCALE,96
OPTION ERRORTRAP,ERROR
DIALOG CREATE,.url Generator,-1,0,200,157
DIALOG ADD,TEXT,TEXT1,13,10,,,This will generate a .url file.
DIALOG ADD,EDIT,EDIT1,35,9,,,Link Name
DIALOG ADD,EDIT,EDIT2,54,9,180,19,Link Path
DIALOG ADD,COMBO,HLANG,73,9,180,21,Your Language
DIALOG ADD,COMBO,OLANG,94,9,180,21,Input Language
DIALOG ADD,BUTTON,Go,122,56,64,24,Go
LIST ADD,HLANG,EN
LIST ADD,HLANG,FR
LIST ADD,HLANG,NL
LIST ADD,OLANG,EN
LIST ADD,OLANG,FR
LIST ADD,OLANG,NL
DIALOG SHOW
:Evloop
wait event
goto @event()
:GoBUTTON
if @null(@DLGTEXT(edit1))
warn Please fill in all fields...
goto evloop
end
if @null(@DLGTEXT(edit2))
warn Please fill in all fields...
goto evloop
end
if @null(@DLGTEXT(hlang))
warn Please fill in all fields...
goto evloop
end
if @null(@DLGTEXT(olang))
warn Please fill in all fields...
goto evloop
end
if @equal(@dlgtext(hlang),nl)
warn I'm not sure the NL option works when accutally tranlating"," but you can try it...
end
if @equal(@dlgtext(olang),nl)
warn I'm not sure the NL option works when accutally tranlating"," but you can try it...
end
INIFILE OPEN,@DLGTEXT(EDIT2)@dlgtext(edit1).URL
INIFILE WRITE,InternetShortcut,URL,javascript:domain=self.location.href;location.href='http://translate.google.com/translate?hl=@dlgtext(hlang)&sl=@dlgtext(olang)&u='+domain;
goto evloop
:ERROR
WARN An error has occurred.
:Close
exit |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Sun Sep 01, 2002 5:41 pm Post subject: |
|
|
You can't get the address from #IEFrame, needs to be from #Edit. Which I imagine isn't reliable since there could be many #Edit's.
You might look into using DDE though.. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Sep 01, 2002 5:44 pm Post subject: |
|
|
If you look with Window Spy, though, you can see another edit called "#Edit", it also holds the address of the page you are viewing... _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Mon Sep 02, 2002 2:05 pm Post subject: |
|
|
Use FreezingFire's idea of winspy to locate the #edit you need and then use a series of @window(..,child) and @window(..,next) to get to the #edit you need to get the URL
I know it works as i've got it working.
Serge _________________
|
|
| 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
|
|