How to use WM_COPY?
-
Hello, How to use WM_COPY if I want to copy some text in other application? ::SendMessage(m_hWnd, WM_COPY, 0, 0); I implemented this but it doesn't work. There's nothing in the clipboard. Help me, please. :-O
Hey, I think the problem might be in your m_hWnd variable. The WM_COPY message should get sent to the window from which you want the data - in this case, the Edit box from the other application. It can be a little tricky to get your hands on this hWnd. My suggestion would be to use ::FindWindow to locate the window in question (you'll need the class name, which is probably "EDIT", and also the window name, which you can get by using Spy++). Hope that helps! Dave
-
Hello, How to use WM_COPY if I want to copy some text in other application? ::SendMessage(m_hWnd, WM_COPY, 0, 0); I implemented this but it doesn't work. There's nothing in the clipboard. Help me, please. :-O
Are you sure your m_hWnd represents edit or combobox control? Only these window classes respond to WM_COPY message. Tomasz Sowinski -- http://www.shooltz.com