/***********************感谢关注************************/
///////////////////////Creamdog/////////////////////////这是剪贴板编程,在MSDN上查一下clipboard,你会得到很多相当信息

解决方案 »

  1.   

    写文本到剪切板: CString source;
    //put your text in source
    if(OpenClipboard())
    {
    HGLOBAL clipbuffer;
    char * buffer;
    EmptyClipboard();
    clipbuffer = GlobalAlloc(GMEM_DDESHARE, source.GetLength()+1);
    buffer = (char*)GlobalLock(clipbuffer);
    strcpy(buffer, LPCSTR(source));
    GlobalUnlock(clipbuffer);
    SetClipboardData(CF_TEXT,clipbuffer);
    CloseClipboard();

    从剪切板读文本
    char * buffer;
    if(OpenClipboard())
    { buffer = (char*)GetClipboardData(CF_TEXT);
    //do something with buffer here
    //before it goes out of scope } CloseClipboard();
      

  2.   

    多谢各位!
    我的意思是对文件的操作。如同Explorer里的功能。