+ Reply to Thread
Results 1 to 2 of 2

Thread: How to achieve drop file functionality with CDialog?

  1. #1

    How to achieve drop file functionality with CDialog?

    How to achieve drop file functionality with CDialog?

  2. #2
    Example:

    Code:
    BEGIN_MESSAGE_MAP(CMyDialog, CDialog)
         ON_MESSAGE(WM_DROPFILES, OnDropFiles)
    END_MESSAGE_MAP()
    
    void CMyDialog::OnDropFiles(HDROP hDropInfo)
    {
    	TCHAR szFileName[MAX_PATH] ;
            DragQueryFile(hDropInfo, 0, szFileName, MAX_PATH) ;
            AfxMessageBox(szFileName) ;
    
    	CDialog::OnDropFiles(hDropInfo) ;
    }
    Also do not forget to make dialog style - "Accept Files".

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts