Home > Net >  VC6 dialog program analog keyboard copy other software text inside, back clipboard is empty
VC6 dialog program analog keyboard copy other software text inside, back clipboard is empty

Time:09-25

I am A little white, use CTRL A CTRL C key combination to copy the text somewhere, back to the RichEdit do text parsing and EditBox, but has not been successful


If (OpenClipboard ())
{
Sleep (4000);
//in order to test the four seconds to move the mouse pointer to a text
Sleep (100);
,0,0,0 mouse_event (MOUSEEVENTF_LEFTDOWN, 0);
Sleep (50);
,0,0,0 mouse_event (MOUSEEVENTF_LEFTUP, 0);



//CTRL A
Keybd_event (VK_CONTROL, 0, 0);
Keybd_event,0,0,0 (65);
KEYEVENTF_KEYUP keybd_event (65, 0, 0);
Keybd_event (KEYEVENTF_KEYUP VK_CONTROL, 0, 0);

Sleep (100);

//CTRL C

Keybd_event (VK_CONTROL, 0, 0);
Keybd_event,0,0,0 (67);
KEYEVENTF_KEYUP keybd_event (67, 0, 0);
Keybd_event (KEYEVENTF_KEYUP VK_CONTROL, 0, 0);

Sleep (100);


//if the function fails, the return value is NULL.
HANDLE hData=https://bbs.csdn.net/topics/::GetClipboardData (CF_UNICODETEXT);

If (hData!=NULL)
{
Cstrings STR.
LPCTSTR lpdata=https://bbs.csdn.net/topics/(LPCTSTR) GlobalLock (hData);
SetDlgItemText (IDC_RICHEDIT1 lpdata);//custom copy where, copied to the edit box here
SetDlgItemText (IDC_EDIT4 lpdata);//custom copy where, copied to the edit box here
GlobalUnlock (hData);
}
CloseClipboard ();
}

}

CodePudding user response:

If you open notepad, according to the control V, there is a text
  • Related