| View previous topic :: View next topic |
| Author |
Message |
VDSuser Contributor


Joined: 21 Mar 2002 Posts: 58 Location: Somewhere in time
|
Posted: Thu Oct 03, 2002 8:39 pm Post subject: Copy Selection - Is it possible? |
|
|
| 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 |
|
 |
laurent_H Contributor


Joined: 30 Jun 2001 Posts: 60
|
Posted: Thu Oct 03, 2002 8:45 pm Post subject: |
|
|
you have to grab keys Ctrl+V
se vdsdll by tomy _________________ Thanks |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Oct 03, 2002 8:47 pm Post subject: |
|
|
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  _________________ 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 |
|
 |
VDSuser Contributor


Joined: 21 Mar 2002 Posts: 58 Location: Somewhere in time
|
Posted: Thu Oct 03, 2002 8:54 pm Post subject: |
|
|
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 |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Oct 03, 2002 9:02 pm Post subject: |
|
|
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  _________________ 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 |
|
 |
VDSuser Contributor


Joined: 21 Mar 2002 Posts: 58 Location: Somewhere in time
|
Posted: Thu Oct 03, 2002 9:02 pm Post subject: |
|
|
| 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 |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Oct 03, 2002 9:03 pm Post subject: |
|
|
I think we posted at about the same time,
ya might check my last post...  _________________ 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 |
|
 |
VDSuser Contributor


Joined: 21 Mar 2002 Posts: 58 Location: Somewhere in time
|
Posted: Thu Oct 03, 2002 9:13 pm Post subject: |
|
|
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 |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Oct 03, 2002 9:21 pm Post subject: |
|
|
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  _________________ 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 |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Thu Oct 03, 2002 9:29 pm Post subject: |
|
|
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 |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Oct 03, 2002 9:37 pm Post subject: |
|
|
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
EDIT - OOPS. Changed to check for the window to
copy from, not paste to...  _________________ 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 |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Fri Oct 04, 2002 12:39 am Post subject: |
|
|
| Code: | WINDOW ACTIVATE,[Window here]
WINDOW SEND,[Window here],@ctrl(C) |
-Garrett |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Fri Oct 04, 2002 3:23 am Post subject: |
|
|
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).
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  _________________ 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 |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Fri Oct 04, 2002 8:34 am Post subject: |
|
|
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...  |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Fri Oct 04, 2002 8:47 am Post subject: |
|
|
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.
Cheers, Mac  _________________ 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 |
|
 |
|