在打开文件对话框里面,当点击一个文件时(不是确定),如何获得这个动作,这样我可以在点击时执行相应的命令?

解决方案 »

  1.   

    自己写一个文件选择对话框类可能比较容易实现,用VC的CFileDialog,就算从它派生一个类,只怕也难,它封装得太严密了……
      

  2.   

    CFileDialog::OnLBSelChangedNotify
    This method is called by the framework whenever the current selection in a list box is about to change. Override this method to provide custom handling of selection changes in the list box. For example, you can use this method to display the access rights or date-last-modified of each file the user selects.virtual void OnLBSelChangedNotify(
    UINT nIDBox,
    UINT iCurSel,
    UINT nCode ); 
    Any more words~!?
      

  3.   

    谢谢各位!
    我解释一下我的问题:
    我使用的程序是 maya(三维软件),maya 本身没有提供文件的缩略图的功能,我想利用maya api 来完成这一功能,在打开文件对话框中,当我点击一个文件时,会在对话框窗口的某一位置,显示该文件的
    缩略图,直到点击确定时,才会真正打开这个文件,这样就不会错误的打开文件,尤其是当场景文件很大时,打开会花费很多时间,但是maya api中没有提供这方面的信息,我想知道是否要调用window的功能,请给一个思路!
      

  4.   

    用CFileDialog::GetPathName()获得文件路径,
    然后你用缩略图的方式打开就好了。
      

  5.   

    没有那么简单,maya的文件不是图片,但是我会想办法预先生成缩略图。
    我想知道在maya里面如何直到这个动作?
    我的msn:[email protected]