| View previous topic :: View next topic |
| Author |
Message |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Tue Oct 19, 2004 10:41 pm Post subject: API and Copy Command? |
|
|
Hi Guys,
Does anyone know of a way to send a copy command to a window (similar to Ctrl-C) using API?
Something like:
%%Activewin = @winactive(C)
%%copy = @sendmsg(~%%Activewin,$0301,0,0)
Which does not work...
Thanks,
- Boo |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Tue Oct 19, 2004 11:11 pm Post subject: |
|
|
| If you are sending a copy command to another window; in your @sendmsg( ) function do not put ~ infront of the window handle. When you put ~ infront of the window handle it tells vds to search for the handle/window in your app and not any global handles/windows that might be open. |
|
| Back to top |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Tue Oct 19, 2004 11:26 pm Post subject: |
|
|
Yeppers, tried that. But to no avail.
Any suggestions?
Thanks,
- Boo |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Tue Oct 19, 2004 11:29 pm Post subject: |
|
|
Hey Boo,
Have you tried,
| Code: |
window send,<window id>,@ctrl(C)
|
_________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Tue Oct 19, 2004 11:31 pm Post subject: |
|
|
Howdy,
Yeppers. The problem is that I want to avoid sending a CTRL key to the window... Was hoping API might be the solution.
Thanks,
- Boo |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Tue Oct 19, 2004 11:36 pm Post subject: |
|
|
Another thought about the function.
Sometimes it is necessary to send the message to the parent window of a
control and then sometime the message needs to be sent to the control
itself.
That might help , and then might not . _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Tue Oct 19, 2004 11:40 pm Post subject: |
|
|
Yeppers, aware of that. But thanks just the same.
I need to avoid use of the CTRL key altogether... |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Wed Oct 20, 2004 1:30 am Post subject: |
|
|
Well.. if you are trying to copy from an editbox/combo and have the actual handle to it, you can send WM_COPY:
| Code: |
%%WM_COPY = $0301
%P = @SENDMSG(<edit/combo handle>,%%WM_COPY,0,0)
|
_________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Wed Oct 20, 2004 1:40 am Post subject: |
|
|
Thanks Sheep. However, how can you use API to copy text from a non-edit/non-combo window/control? Such as highlighted text on a Web page?
FYI: The following API code works fine in VDS 3.5, but not in version 5.x:
| Code: | %%pos = @mousepos(XY)
parse "%%Xpos;%%Ypos",%%pos
%x = @WINATPOINT(%%Xpos,%%Ypos)
%z = @sendmsg(%x,$0301,0,0) |
Thanks,
- Boo[/code:1:c251638227] |
|
| Back to top |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Wed Oct 20, 2004 1:48 am Post subject: |
|
|
Correction. The above code in VDS 3.5 and VDS 5.x, but only when copying text from certain edit boxes/combos.
Still need a solution for copying text from windows/controls other than edit boxes/combos. (That is, that contain text that may be copied/pasted.)
Last edited by Boo on Wed Oct 20, 2004 2:03 am; edited 1 time in total |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Wed Oct 20, 2004 2:03 am Post subject: |
|
|
I'm really not sure on how to copy selected text from another window unless it's in an edit. Odd that WM_COPY worked on non-edit windows in VDS 3..
Maybe someone else knows something I'm missing. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Wed Oct 20, 2004 9:27 am Post subject: |
|
|
WM_COPY is just a Windows message. I can't see how it could make any difference what version of VDS is sending it.
However, it's certainly possible that some controls other than the basic Windows controls don't support WM_COPY. For example, many enhanced components created using VCL in Delphi. The developer may not have provided support for this message. In that case, sendng CTRL-C to the application may work, but still only if the developer provided support for this shortcut. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Wed Oct 20, 2004 1:03 pm Post subject: |
|
|
Yeppers, it seems to work in VDS 3.5 and 5.0, but only in editboxes/combos.
Still hoping for a solution for the copying of non-editable text.... |
|
| Back to top |
|
 |
|