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 


Copy Selection - Is it possible?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
VDSuser
Contributor
Contributor


Joined: 21 Mar 2002
Posts: 58
Location: Somewhere in time

PostPosted: Thu Oct 03, 2002 8:39 pm    Post subject: Copy Selection - Is it possible? Reply with quote

I want to write a proggie that will copy selected text to the clipboard, similar to highlighting text and pressing Ctrl-C. I'm particularly interested in copying selected text from a web page. Any ideas?
Back to top
View user's profile Send private message
laurent_H
Contributor
Contributor


Joined: 30 Jun 2001
Posts: 60

PostPosted: Thu Oct 03, 2002 8:45 pm    Post subject: Reply with quote

you have to grab keys Ctrl+V
se vdsdll by tomy

_________________
Thanks
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Oct 03, 2002 8:47 pm    Post subject: Reply with quote

You should be able to send @ctrl(C) to the active
Window once the text is hilighted...
Code:

WINDOW SEND, @winactive(), @ctrl(C)

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
VDSuser
Contributor
Contributor


Joined: 21 Mar 2002
Posts: 58
Location: Somewhere in time

PostPosted: Thu Oct 03, 2002 8:54 pm    Post subject: Reply with quote

The WINDOW SEND won't work under normal conditions -- clicking my program to send the command makes my proggie the active window. But it does give me another idea. Stay tuned, I'll get back to you!

Thanks.
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Oct 03, 2002 9:02 pm    Post subject: Reply with quote

You can use a loop to check for your window NOT being
active (I'd include a way to break the loop with an event
as shown here).
Code:

REPEAT
  WAIT ".01"
  %e = @event()
UNTIL @not(@equal(@winactive(),"Your Program Window Name"))%e
WINDOW SEND, @winactive(), @ctrl(C)

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
VDSuser
Contributor
Contributor


Joined: 21 Mar 2002
Posts: 58
Location: Somewhere in time

PostPosted: Thu Oct 03, 2002 9:02 pm    Post subject: Reply with quote

Nah, my idea didn't work. I'll keep scratching my head, though. If I need more help, I'll ask. Thanks for responding so quickly.
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Oct 03, 2002 9:03 pm    Post subject: Reply with quote

I think we posted at about the same time,
ya might check my last post... Wink

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
VDSuser
Contributor
Contributor


Joined: 21 Mar 2002
Posts: 58
Location: Somewhere in time

PostPosted: Thu Oct 03, 2002 9:13 pm    Post subject: Reply with quote

Oops, sorry, Mac, I didn't see your LOOP idea. Actually, that was the idea I was trying.

Here's the deal. When I want to copy text from a web page and paste it into my email client (Outlook), the client wants to be literal and reproduce all the formatting. I don't want that.

I've been highlighting text, pressing Ctrl-C, pasting the data into Notepad (where it shows unformatted), then copying the Notepad text and pasting the unformatted data back into Outlook. Too much trouble.

I want to highlight the text and press my TASKICON, which then copies the text to the clipboard. Once it's there, no sweat using LIST to take it out of the clipboard and put it back into the clipboard, a process that removes the formatting.

The LOOP idea works until I open Outlook. As soon as it's open, the loop tries to read from Outlook.

I'll keep working on it.
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Oct 03, 2002 9:21 pm    Post subject: Reply with quote

That's not supposed to be a continous loop,
put it under your TaskbarCLICK (or whatever
ya use) so it only activates when ya want to
copy the text.

I used it in a WINDOW ONTOP program that's
in the VDS3 source code section.

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Thu Oct 03, 2002 9:29 pm    Post subject: Reply with quote

You could also avoid losing focus from your browser window by making your program a part of the browser interface. Try to look here:
http://www.vdsworld.com/forum/viewtopic.php?t=531

That is a program which removes formating from browser selections + instruction etc. to make yourself a regular browser
button to call the program.

I use this one not only for copying code snippets from my browser to VDS but also for copying non-formated text into Word etc. when I don't
want the layout etc. transferred. It could, of course, be used for Outlook as well.

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Oct 03, 2002 9:37 pm    Post subject: Reply with quote

If it doesn't work checking for your program active,
ya can check for the window you're copying being
active (use whatever window ya need below):
Code:

REPEAT
  WAIT ".01"
  %e = @event()
UNTIL @equal(@winactive(), "Window to copy from")%e
WINDOW SEND, @winactive(), @ctrl(C)

Cheers, Mac Smile

EDIT - OOPS. Changed to check for the window to
copy from, not paste to... Embarassed

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361


Last edited by Mac on Fri Oct 04, 2002 3:14 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Fri Oct 04, 2002 12:39 am    Post subject: Reply with quote

Code:
WINDOW ACTIVATE,[Window here]
WINDOW SEND,[Window here],@ctrl(C)


-Garrett
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Oct 04, 2002 3:23 am    Post subject: Reply with quote

Garrett, you're idea is better anyway, since the task icon
click alone doesn't have an active window (in fact it just
makes @winactive() null). Wink

Lol, I was asleep at the wheel on my last post...

The loop is nice though if your prog has an active window.
You can get info (or do whatever) with any window ya click
on, not just a specific one.

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Skit3000
Admin Team


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

PostPosted: Fri Oct 04, 2002 8:34 am    Post subject: Reply with quote

What about useing this?

Code:

dialog create,New Dialog,0,0,0,0
dialog add,taskicon,taskicon

:Evloop
repeat
%%selectedwindow = @winactive()
wait 1
%%event = @event()
until %%event
goto %%event

:Taskiconclick
window send,%%selectedwindow,@ctrl(c)
list create,1
list paste,1
info The selected text is:@cr()@text(1)
rem window,send,Whatwindow,@text(1)
list close,1
goto evloop

:Close
exit


It took me exactly 3 minutes and 25 seconds to do it... Razz
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Oct 04, 2002 8:47 am    Post subject: Reply with quote

Yeah, well ya might try testing it a little longer.

Try selecting some (not all) of the text in IE a
few times...

Ya might want to add an exit routine as well...

Not a bad idea though. Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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