Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending Text to another app using wm_paste

Status
Not open for further replies.

rwblinn

Programmer
Jan 3, 2001
3
0
0
DE
I want to sent text using sendmessage and wm_paste to another app like notepad or outlook memo-field. this works fine for notepad, but not for outlook or winword. what do i do wrong. I use
1/Memo1.CopyToClipboard;
to send selected text from memo field to clipboard.

2/hWndParent := FindWindow(nil, PChar(sWindow));
to find the window where the text should go. sWindow is f.e.'notepad' or 'new message' for outlook
3/hWndChild := ChildWindowFromPoint(hWndParent, point(50,50));
to get the handle of the window I want to sent text to.
4/SendMessage(hWndChild, WM_PASTE, 1, 0);
to paste the text into the window

Note: I tried using wm_char. Same result as described above
 
Maybe u should try different coordinates, or you can try to get the handle of the focussed childwindow. But if you know the handle or classname of the editfield already you can setfocus to them. (and then you can use the WM_SetText message)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top