1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| //j'ai essayé de mettre le EmptyClipboard(); ici (avec un OpenClipboard(NULL) avant)
keybd_event(VK_CONTROL, MapVirtualKey(VK_CONTROL,0), 0, 0);
keybd_event(0x43, MapVirtualKey(0x43,0), 0, 0);
keybd_event(0x43, MapVirtualKey(0x43,0), KEYEVENTF_KEYUP, 0);
keybd_event(VK_CONTROL, MapVirtualKey(VK_CONTROL,0), KEYEVENTF_KEYUP, 0);
LPTSTR lptstr;
HGLOBAL hglb;
if(OpenClipboard(NULL))
{
hglb = GetClipboardData(CF_UNICODETEXT);
if (hglb != NULL)
{
lptstr = (LPTSTR)GlobalLock(hglb);
if(lptstr)
{
MessageBox(NULL, lptstr, _T("Selected Text"), MB_OK);
}
GlobalUnlock(hglb);
EmptyClipboard();
CloseClipboard();
}
} |
Partager