![]() |
|
|
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
According to the Win32 Programmer's Reference both wParam and lParam should be zero. So :
SendMessage(hWndChild,WM_PASTE,0,0); If it still doesn't work then check if the data in the clipboard is in CF_TEXT format. |
|
#3
|
|||
|
|||
|
Hi :
Try this, it may be a better aproach, With the help of the API function GlobalAddAtom its possible to send a string via the Windows API. The function returns a number, which can be used at wParam or lParam from PostMessage (or SendMessage). Sender: wParam = GlobalAddAtom('string...') PostMessage(HWnd, WM_XYZ, wParam, 0) Receiver: str = GlobalGetAtomName(wParam) GlobalDeleteAtom(wParam) Good luck, Osama. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|