Click here to Skip to main content
15,920,217 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi How Can I:
Get clipboard Data
with Visual C++ MFC 2010 ?
thanks a lot
Posted

C++
HANDLE  stringData;
char    string[4096];

if (OpenClipboard(0))
{
    if ((stringData = GetClipboardData(CF_TEXT)) != NULL)
    {
        strncpy(string, (char *) stringData, 4096);
        string[4095] = '\0'; // Truncate if needed
        CloseClipboard();
        return string ;
    }
    else
        CloseClipboard();
}
 
Share this answer
 
v2
See "Using The Clipboard"[^] at MSDN.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900