I have an application which has a button on Click of button am trying to paste the text already available to Notepad. My application gathers the text first and puts it on the clipboard(this is working perfectly fine), I am facing problem with the Paste part. Here is the code, Please let me know where am i going wrong.
CWnd *pCwnd = FindWindow(NULL, _T("Untitled - Notepad"));
HWND handle = pCwnd->GetSafeHwnd();
pCwnd->PostMessageA(WM_PASTE,0,0);
I am using Notepad to test it so the name is ("Untitled - Notepad"). Please help me. Thanks in advance.