plz help: sendkeys and the clipboard

plz help: sendkeys and the clipboard

Post by Baphome » Wed, 18 Apr 2001 04:30:18



i wrote what i thought would be a simple program .. it activates another
program, tabs to where some text is (in a text box) and the text is
highlighted when the tab reaches it, copies the highlighted text to the
clipboard, and then moves the clipboard string to my vb program. here's my
code:

Private Sub Form_Click()

AppActivate ("Location Profile")    'my program i want to copy from

SendKeys "{tab}"
SendKeys "{tab}"
SendKeys "{tab}"
SendKeys "{tab}"
SendKeys "{tab}"                             'this highlights a string of
text in the program

SendKeys "^c"                                 'i assume this simulates
CTRL+C to copy
                                                           'everything works
fine up till this point
Text1.Text = Clipboard.GetText     'should set text1.text to whatever is in
the clipboard, right?

End Sub

when i run this and click form1, focus is changed to the window called
"Location Profile", but instead of text1.text changing to what's on the
clipboard, the default text there is deleted instead. if i go into notepad
and paste, however, the data DOES paste, so i know everything is working up
until the line "Text1.Text = Clipboard.GetText".

can anyone tell me what i'm missing?

thanks,
Jeff

 
 
 

1. Help with SendKeys

Newsgroups: comp.os.ms-windows.programmer
Date: Fri, 18 Aug 95 23:10:24 PDT

Subject: Help with SendKeys
X-Newsreader: NEWTNews & Chameleon -- TCP/IP for MS Windows from NetManage
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

        I found an article in the MSDN cd which implemented Sendkeys in a DLL.  I
managed to import the function, but I can only run my application once.  I suspect that
My application is not freeing up the DLL.  How would I do this?  I did not explicitly
LOADLIB my DLL (the dll's functions were listed in the .def file's EXPORTS section).  
In otherwords, the library is loaded only when my application calls a DLL function.
        In case it isn't already obvious, this is the 1st time I have tried to use a DLL.

PS - I'm using BC4.  If I run my application once, exit it and then try to re-make my
project, the compiler complains that an application is still using the library.  Hope this
makes my situation a little more clear.

2. Forsale: MicroVAX II CPU Board (KA630)

3. How does Office Clipboard work (12 clipboards in one)??!!

4. dxf or dwg world map needed

5. SendKeys Need help!!!

6. FS: EXTERNAL SCSI ZIP DRIVE

7. sendkeys and hwnd - need help

8. Performance, DataViews and DataAdapters questions

9. (Help Plz)Linking error while using CString::AllocSysString

10. help me plz.. T_T

11. TAPI 3.0 c# Event registration help plz

12. Help Me Plz

13. Help me Plz