我的程序想在系统文字拷贝的时候触发自己写好的某个事件,如何实现?

解决方案 »

  1.   

    void CNumberEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) 
    {
        
        if( nChar == 3 )               // Ctrl + C
        {
            //Add your message handler code here and/or call default    } CEdit::OnChar(nChar, nRepCnt, nFlags);
    }
      

  2.   

    An application sends the WM_COPY message to an edit control or combo box to copy the current selection to the clipboard in CF_TEXT format. 
      

  3.   

    to:shadowWind(欧要开始学jb啦,呼呼)
       我拷贝的东西不在当前程序里,是其他程序拷贝的文本,已经到了系统剪贴板上,通过paste()也可以取到拷贝的内容,但是这个事件触发我怎么才能捕获?
      

  4.   

    简单的说就是我的程序如何获得系统剪贴板的内容,并且当系统拷贝新内容到剪贴板时,我的程序也会paste到新的内容。关键在于如何知道系统又进行了拷贝操作。
    当然也可以写timer或线程来不停判断剪贴板的内容是不是变了,但这就有点舍近求远了。
      

  5.   

    http://www.vchelp.net/vchelp/zsrc/clipboard_mon.zip
    zhaodao找到一个例子
    大家一起学习