|
-
Jun 26th, 2000, 03:55 AM
#1
Thread Starter
Lively Member
I have a small program that "should" envoke the Paste command within another edit control, code is below.
Private Sub Command1_Click()
Clipboard.Clear 'Clears Clipboard
Clipboard.SetData Picture1.Picture 'Copys the Picture Into The ClipBoard
Call SendMessage(TxtBox&, WM_PASTE, 0, 2) 'TxtBox& is the hWnd of a richedit control and "envokes" the Paste Command.
End Sub
The Problem I am having is that it works within its self meaning it is only working within the same exe that it was made in but not other apps like wordpad.
Does anyone have another Idea how to do it or how to fix this code?
Thank you,
Jeremy
-
Jun 26th, 2000, 04:15 AM
#2
transcendental analytic
Sendkeys "^v" should work
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 26th, 2000, 04:46 AM
#3
Fanatic Member
Look up Clipboard.GetData and Clipboard.GetText.
Another thing, there are APIs for Clipboard events.
Code:
Private Declare Function OpenClipboard Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function EmptyClipboard Lib "user32" () As Long
Private Declare Function SetClipboardData Lib "user32" (ByVal wFormat As Long, ByVal hMem As Long) As Long
'if you have problems with this function add the Alias "SetClipboardDataA"
Private Declare Function CloseClipboard Lib "user32" () As Long
-
Jun 26th, 2000, 04:50 AM
#4
Thread Starter
Lively Member
Thank You Both for replying I tried one way out and it worked but I would still rather go with api so I am going to try Nitro's way here real quick and see what happens
Thanx Again,
Jeremy
-
Jun 26th, 2000, 05:21 AM
#5
transcendental analytic
Actually Clipboard object can be used instead of Nitros code, but it's not too fast either, but anyway i think that's not the problem
Anyway you need to send you data to that app and Sendkeys would be the best way and ^v for the pasting command.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|