forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Get text from an element on another window

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Sep 01, 2002 2:54 pm    Post subject: Get text from an element on another window Reply with quote

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
View user's profile Send private message Visit poster's website
Federico
VDS Pirate
VDS Pirate


Joined: 03 Aug 2002
Posts: 8

PostPosted: Sun Sep 01, 2002 2:58 pm    Post subject: Reply with quote

GetWindowText
SetWindowText
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Sep 01, 2002 3:07 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sun Sep 01, 2002 3:11 pm    Post subject: Reply with quote

Use this:

%z = @sendmsg(@winexists(#IEFRAME),Messagenumber,wparam,lparam)
Back to top
View user's profile Send private message
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Sun Sep 01, 2002 3:13 pm    Post subject: Reply with quote

I think simply the @wintext() function will do, in conjunction with the appropriate window
identifier.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Sep 01, 2002 3:22 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Sep 01, 2002 3:27 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Sep 01, 2002 4:45 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Sun Sep 01, 2002 5:41 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Sep 01, 2002 5:44 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Mon Sep 02, 2002 2:05 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group