Skip to main content

Featured

Build docker image from multiple build contexts

Build docker image from multiple build contexts Building a docker image requires specifying a source of truth to include in the image from a local directory or a remote git repository. In the previous version, the docker BuildKit allows users to specify the build context from a single source of truth only. However, the engineers may need to have the context from different locations based on the type of files. For instance, icons, images or other resources that are not included in the same package, including the resource from other docker images. Fortunately, the Docker Buildx toolkit supports multiple build context flag for Docker 1.4. Let's learn how to use this new feature. The following list is a shortcut for jumping into a specific topic handy. What version of Docker is this tutorial targeting? How to specify the version of Dockerfile frontend? Ho

[CListCtrl]拖曳檔案至List上方

如要操作行為正確,此方法需先繼承CListCtrl之後,並改寫OnDropFiles()。

如不太強調行為正確,則改寫Dialog的OnDropFiles()也可以。

這邊選用偷懶的方式,直接改寫Dialog的OnDropFiles()。

1.先要將Dialog(CListCtrl)的Accept File屬性打開,這樣才能將檔案拖到Dialog上面並丟下。

2.加入自定訊息的

3.ON_WM_DROPFILES()

enum eMyListCtrl{ WM_USER_CHANGE_LIST = WM_APP + 0x0100 };  
   
 ON_MESSAGE( WM_USER_CHANGE_LIST, OnDropFilesToList )  
   
 void CFileSearchDlg::OnDropFiles(HDROP hDropInfo)  
 {  
   // TODO: Add your message handler code here and/or call default  
    char  cFilePathName[_MAX_PATH] = {0};  
    UINT nNumOfFiles = DragQueryFile(hDropInfo, 0xFFFFFFFF, NULL, 0); //文件的个数  
    for ( UINT nIndex=0 ; nIndex< nNumOfFiles; ++nIndex )  
    {  
      DragQueryFile(hDropInfo, nIndex, cFilePathName, _MAX_PATH); //得到文件名  
      // 把得到的文件名传给父窗口  
      LPARAM lParam = (LPARAM)cFilePathName;  
      //GetParent()->SendMessage(WM_USER_CHANGE_LIST,0,lParam);  
      this->SendMessage(WM_USER_CHANGE_LIST,0,lParam);  
    }  
   
   CDialog::OnDropFiles(hDropInfo);  
 }  
   
 LRESULT CFileSearchDlg::OnDropFilesToList(WPARAM wParam, LPARAM lParam)  
 {  
   //m_wndListCtrl.DeleteAllItems();  
   char * cFilePath = (char *)lParam;// 得到拖放文件的路径  
   
   //Check is dir or File Path  
   this->SearchFileList(cFilePath);  
   
   return true;  
 }  

Comments

Popular Posts