这篇教程C++ DragFinish函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DragFinish函数的典型用法代码示例。如果您正苦于以下问题:C++ DragFinish函数的具体用法?C++ DragFinish怎么用?C++ DragFinish使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DragFinish函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: DragQueryFileWvoid DragData::asFilenames(Vector<String>& result) const{ WCHAR filename[MAX_PATH]; STGMEDIUM medium; if (FAILED(m_platformDragData->GetData(cfHDropFormat(), &medium))) return; HDROP hdrop = (HDROP)GlobalLock(medium.hGlobal); if (!hdrop) return; const unsigned numFiles = DragQueryFileW(hdrop, 0xFFFFFFFF, 0, 0); for (unsigned i = 0; i < numFiles; i++) { if (!DragQueryFileW(hdrop, 0, filename, ARRAYSIZE(filename))) continue; result.append((UChar*)filename); } // Free up memory from drag DragFinish(hdrop); GlobalUnlock(medium.hGlobal);}
开发者ID:Czerrr,项目名称:ISeeBrowser,代码行数:25,
示例2: DragAcceptFilesvoid CFilesHashDlg::OnDropFiles(HDROP hDropInfo){ if(!m_thrdData.threadWorking) { unsigned int i; TCHAR szDragFilename[MAX_PATH]; DragAcceptFiles(FALSE); m_thrdData.nFiles = DragQueryFile(hDropInfo, -1, NULL, 0); ClearFilePaths(); for(i=0; i < m_thrdData.nFiles; i++) { DragQueryFile(hDropInfo, i, szDragFilename, sizeof(szDragFilename)); CString tmp; tmp.Format(_T("%s"), szDragFilename); m_thrdData.fullPaths.push_back(tmp); } DragFinish(hDropInfo); DragAcceptFiles(TRUE); DoMD5(); }}
开发者ID:Koogoo,项目名称:fhash,代码行数:25,
示例3: DragQueryFile//---------------------------------------------------------------------------void __fastcall TRefEditForm::WMDropFiles(TWMDropFiles &message){ AnsiString FileName; FileName.SetLength(MAX_PATH); int Count = DragQueryFile((HDROP)message.Drop, 0xFFFFFFFF, NULL, MAX_PATH); // index through the files and query the OS for each file name... for (int index = 0; index < Count; ++index) { // the following code gets the FileName of the dropped file. I know it // looks cryptic but that's only because it is. Hey, Why do you think // Delphi and C++ Builder are so popular anyway? FileName.SetLength(DragQueryFile((HDROP)message.Drop, index, FileName.c_str(), MAX_PATH)); // examine the filename's extension. // If it's a Word file then ... if (UpperCase(ExtractFileExt(FileName)) == ".DOC") { ListBox_Words->Items->Add(FileName); } } // tell the OS that we're finished... DragFinish((HDROP) message.Drop);}
开发者ID:DmytroBiriukov,项目名称:RefEditor,代码行数:28,
示例4: OnDropFilesvoid OnDropFiles(HDROP hdrop){ if(!hdrop) return; int filesDropped = DragQueryFile(hdrop, 0xffffffff, NULL, 0); //获取拖拽文件的个数 TCHAR pathDropped[1024]; for(int i = 0; i < filesDropped; ++i) { ZeroMemory(pathDropped, sizeof(pathDropped)); DragQueryFile(hdrop, i, pathDropped, 1024); if (0 == _tcsicmp(::PathFindExtension(pathDropped), TEXT(".bmp"))) { _tcscpy(pathOut, pathDropped); } else { ::StringCbCopy(pathOut, sizeof(pathOut), pathDropped); ::PathRemoveExtension(pathOut); ::PathAddExtension(pathOut, TEXT(".bmp")); Png2AlphaBitmap(pathDropped, pathOut); } } DragFinish(hdrop);}
开发者ID:yedaoq,项目名称:YedaoqToolSpace,代码行数:30,
示例5: OnDropFilevoid OnDropFile (DWORD wParam) { TCHAR FileName [FilePathLen + 1] ; LPTSTR pFileNameStart ; HANDLE hFindFile ; WIN32_FIND_DATA FindFileInfo ; int NameOffset ; int NumOfFiles = 0 ; NumOfFiles = DragQueryFile ((HDROP) wParam, 0xffffffff, NULL, 0) ; if (NumOfFiles > 0) { // we only open the first file for now DragQueryFile((HDROP) wParam, 0, FileName, FilePathLen) ; pFileNameStart = ExtractFileName (FileName) ; NameOffset = pFileNameStart - FileName ; // convert short filename to long NTFS filename if necessary hFindFile = FindFirstFile (FileName, &FindFileInfo) ; if (hFindFile && hFindFile != INVALID_HANDLE_VALUE) { // append the file name back to the path name lstrcpy (&FileName[NameOffset], FindFileInfo.cFileName) ; FindClose (hFindFile) ; } FileOpen (hWndMain, (int)0, (LPTSTR)FileName) ; PrepareMenu (GetMenu (hWndMain)); } DragFinish ((HDROP) wParam) ; }
开发者ID:mingpen,项目名称:OpenNT,代码行数:33,
示例6: HandleFilesvoid HandleFiles(WPARAM wParam) { // DragQueryFile() takes a LPWSTR for the name so we need a TCHAR string TCHAR szName[MAX_PATH]; // Here we cast the wParam as a HDROP handle to pass into the next functions HDROP hDrop = (HDROP)wParam; // This functions has a couple functionalities. If you pass in 0xFFFFFFFF in // the second parameter then it returns the count of how many filers were drag // and dropped. Otherwise, the function fills in the szName string array with // the current file being queried. int count = DragQueryFile(hDrop, 0xFFFFFFFF, szName, MAX_PATH); // Here we go through all the files that were drag and dropped then display them for (int i = 0; i < count; i++) { // Grab the name of the file associated with index "i" in the list of files dropped. // Be sure you know that the name is attached to the FULL path of the file. DragQueryFile(hDrop, i, szName, MAX_PATH); // Bring up a message box that displays the current file being processed MessageBox(GetForegroundWindow(), szName, "Current file received", MB_OK); } // Finally, we destroy the HDROP handle so the extra memory // allocated by the application is released. DragFinish(hDrop);}
开发者ID:suhockii,项目名称:rsa-encryption,代码行数:29,
示例7: ASSERTvoid CFileEditCtrl::OnDropFiles(HDROP hDropInfo) { // handles drag and drop file entry, control must have the // WS_EX_ACCEPTFILES extended style set. CString szSeperator;#if defined FEC_NORESOURCESTRINGS szSeperator = FEC_IDS_SEPERATOR;#else szSeperator.LoadString(FEC_IDS_SEPERATOR);#endif ASSERT (_tcslen(szSeperator) == 1); // must be one character only szSeperator += _T(" "); // get the file seperator character CString szDroppedFiles; // buffer to contain all the dropped files TCHAR lpstrDropBuffer[_MAX_PATH]; UINT nDropCount = DragQueryFile(hDropInfo,0xffffffff,NULL,0); if (nDropCount && (m_bFindFolder || (!m_bFindFolder && !(m_pCFileDialog->m_ofn.Flags & OFN_ALLOWMULTISELECT)))) nDropCount = 1; if (nDropCount) { DragQueryFile(hDropInfo, 0, lpstrDropBuffer, _MAX_PATH); szDroppedFiles = lpstrDropBuffer; } for (UINT x = 1; x < nDropCount; x++) { DragQueryFile(hDropInfo, x, lpstrDropBuffer, _MAX_PATH); szDroppedFiles += szSeperator; szDroppedFiles += lpstrDropBuffer; } DragFinish (hDropInfo); SetWindowText (szDroppedFiles);}
开发者ID:moodboom,项目名称:Reusable,代码行数:32,
示例8: handle_dropstatic voidhandle_drop( HDROP hDrop ){ size_t bufsize; char *namebuf; /* Check that only one file was dropped */ if( DragQueryFile( hDrop, ~0UL, NULL, 0 ) == 1) { bufsize = DragQueryFile( hDrop, 0, NULL, 0 ) + 1; if( ( namebuf = malloc( bufsize ) ) ) { DragQueryFile( hDrop, 0, namebuf, bufsize ); fuse_emulation_pause(); utils_open_file( namebuf, tape_can_autoload(), NULL ); free( namebuf ); display_refresh_all(); fuse_emulation_unpause(); } } DragFinish( hDrop );}
开发者ID:jacadym,项目名称:fuse-emulator,代码行数:25,
示例9: DragQueryFilevoid CPatchListCtrl::OnDropFiles(HDROP hDropInfo){ UINT nNumFiles = DragQueryFile(hDropInfo, 0xFFFFFFFF, nullptr, 0); for (UINT i = 0; i < nNumFiles; ++i) { CString file; DragQueryFile(hDropInfo, i, file.GetBufferSetLength(MAX_PATH), MAX_PATH); file.ReleaseBuffer(); if (PathIsDirectory(file)) continue; // no duplicates LVFINDINFO lvInfo; lvInfo.flags = LVFI_STRING; lvInfo.psz = file; if (FindItem(&lvInfo, -1) != -1) continue; int index = InsertItem(GetItemCount(), file); if (index >= 0) SetCheck(index, true); } DragFinish(hDropInfo); SetColumnWidth(0, LVSCW_AUTOSIZE);}
开发者ID:iamduyu,项目名称:TortoiseGit,代码行数:25,
示例10: onDropFile/*----------*/void onDropFile(HDROP hDrop){ DWORD i, nb, len; wchar_t wbuf[MAX_PATH+32]; wchar_t* wp; nb = DragQueryFile(hDrop, (DWORD)-1, NULL, 0); for(i = 0 ; i < nb ; i++) { len = DragQueryFile(hDrop, i, NULL, 0); if(len < 1 || len > MAX_PATH) continue; wp = wbuf + 1; if(! DragQueryFile(hDrop, i, wp, MAX_PATH)) continue; wp[len] = 0; while(*wp > 0x20) wp++; if(*wp) { wp = wbuf; len++; wp[0] = wp[len++] = L'/"'; } else { wp = wbuf + 1; } wp[len++] = L' '; __write_console_input(wp, len); } DragFinish(hDrop);}
开发者ID:u338steven,项目名称:afxtools,代码行数:31,
示例11: USEunsigned DragData::numberOfFiles() const{#if USE(CF) if (!m_platformDragData) return 0; STGMEDIUM medium; if (FAILED(m_platformDragData->GetData(cfHDropFormat(), &medium))) return 0; HDROP hdrop = static_cast<HDROP>(GlobalLock(medium.hGlobal)); if (!hdrop) return 0; unsigned numFiles = DragQueryFileW(hdrop, 0xFFFFFFFF, 0, 0); DragFinish(hdrop); GlobalUnlock(medium.hGlobal); return numFiles;#else return 0;#endif}
开发者ID:Wrichik1999,项目名称:webkit,代码行数:25,
示例12: ase_wnd_procstatic LRESULT CALLBACK ase_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam){ switch (msg) { case WM_DROPFILES: { ScopedLock lock(*dropped_files_mutex); HDROP hdrop = (HDROP)(wparam); int index, count, length; count = DragQueryFile(hdrop, 0xFFFFFFFF, NULL, 0); for (index=0; index<count; ++index) { length = DragQueryFile(hdrop, index, NULL, 0); if (length > 0) { TCHAR* lpstr = new TCHAR[length+1]; DragQueryFile(hdrop, index, lpstr, length+1); dropped_files->push_back(lpstr); delete[] lpstr; } } DragFinish(hdrop); } break; } return ::CallWindowProc(base_wnd_proc, hwnd, msg, wparam, lparam);}
开发者ID:RobertLowe,项目名称:aseprite,代码行数:28,
示例13: Thread/* Поток для загрузки музыки в плейлист*/DWORD WINAPI Thread(LPVOID lp){ HDROP hDrop = (HDROP)lp; CHAR szFileName[MAX_PATH]; TCHAR buff[MAX_PATH]; DWORD dwCount = DragQueryFileA(hDrop, 0xFFFFFFFF, szFileName, MAX_PATH); //Определение количества загружаемых песен for (INT i = 0; i < dwCount; i++) { DragQueryFileA(hDrop, i, szFileName, MAX_PATH); //Определение пути к файлу INT len = strlen(szFileName); CHAR buffFormat[4]; //Формат песни INT j = 0; //для прохода по буферу формата песни for (INT i = len - 4; i < len; i++) { buffFormat[j] = szFileName[i]; j++; } if (me_strcmp(".mp3", buffFormat)) { HSTREAM stream = BASS_StreamCreateFile(0, szFileName, 0, 0, 0); //Создание потока mbstowcs(buff, szFileName, MAX_PATH); //преобразование CHAR to TCHAR DlgPlayList::_this->addSongToPlayList(stream, buff); //Добавление песни в плейлист } } DragFinish(hDrop); return FALSE;}
开发者ID:vitahalyubimov,项目名称:Course-WinAPI,代码行数:30,
示例14: system_event_procvoid system_event_proc(SDL_SysWMmsg *m, AnimPlayer *p){ //process drag and drop event #if TARGET_OS == WIN if(m->msg == WM_DROPFILES) { TCHAR lpszFile[1000]; //buffer for file path HDROP hDrop = (HDROP)(m->wParam); DragQueryFile(hDrop, 0, lpszFile, 1000); DragFinish(hDrop); //char *file = WIN_StringToUTF8(buffer); //CStringA cstrText(lpszFile); //cout << "File dragged: " << lpszFile << endl; cout << "File dragged!" << endl; //player polls string //if string is not empty, player opens file path p->file_to_open = (const char*)(lpszFile); } #elif TARGET_OS == LINUX if(m->subsystem == SDL_SYSWM_X11) { //todo //XdndAware XdndDrop } #endif //other OS ...}
开发者ID:murkymark,项目名称:iffanimplay,代码行数:30,
示例15: text_drag_drop/* Windows 3.1 drag-drop feature */voidtext_drag_drop(TW *tw, HDROP hdrop){ TCHAR *szFile; int i, cFiles; unsigned int Len, error; const char *p; const TCHAR *t; if ( (tw->DragPre==NULL) || (tw->DragPost==NULL) ) return; cFiles = DragQueryFile(hdrop, (UINT)(-1), (LPTSTR)NULL, 0); for (i=0; i<cFiles; i++) { Len = DragQueryFile(hdrop, i, NULL, 0); szFile = (TCHAR *)malloc((Len+1)*sizeof(TCHAR)); if (szFile != 0) { error = DragQueryFile(hdrop, i, szFile, Len+1); if (error != 0) { for (p=tw->DragPre; *p; p++) SendMessage(tw->hwnd,WM_CHAR,*p,1L); for (t=szFile; *t; t++) { if (*t == '//') SendMessage(tw->hwnd,WM_CHAR,'/',1L); else SendMessage(tw->hwnd,WM_CHAR,*t,1L); } for (p=tw->DragPost; *p; p++) SendMessage(tw->hwnd,WM_CHAR,*p,1L); } free(szFile); } } DragFinish(hdrop);}
开发者ID:BorodaZizitopa,项目名称:ghostscript,代码行数:35,
示例16: DragQueryFileLRESULT MetroWindow::OnDropfiles(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL & bHandled){ const LPCWSTR PackageSubffix[] = { L".exe", L".dll", L".com", L".sys", L"scr", L"fon", L"drv" }; HDROP hDrop = (HDROP)wParam; UINT nfilecounts = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0); WCHAR dropfile_name[MAX_PATH]; std::vector<std::wstring> filelist; for (UINT i = 0; i < nfilecounts; i++) { DragQueryFileW(hDrop, i, dropfile_name, MAX_PATH); auto ext=PathFindExtensionW(dropfile_name); if (ext) { for (auto s : PackageSubffix) { if (_wcsicmp(s, ext)) { filelist.push_back(dropfile_name); break; } } } if (!filelist.empty()) { ::SetWindowTextW(::GetDlgItem(m_hWnd, IDC_IMAGE_URI_EDIT), filelist[0].c_str()); if (PortableExecutableFileRander(filelist.at(0)) != S_OK) { ::MessageBoxW(m_hWnd, filelist.at(0).c_str(), L"Cannot analyzer this file", MB_OK | MB_ICONSTOP); return S_FALSE; } } } DragFinish(hDrop); ::InvalidateRect(m_hWnd, NULL, TRUE); return S_OK;}
开发者ID:fcharlie,项目名称:PEAnalyzer,代码行数:30,
示例17: DragQueryFile/** @fn void CTransportDlg::OnDropFiles(HDROP hDropInfo) * @brief 拖拉文件至主窗口,启动文件发送线程发送文件 * @param hDropInfo 系统定义. */void CTransportDlg::OnDropFiles(HDROP hDropInfo){ char *filename = new char[100]; int count = ::DragQueryFile(hDropInfo, 0xffffffff, NULL, 512); //get count of dropped files for (int i = 0; i < count; i++) { //get filename int nchar = DragQueryFile(hDropInfo, i, filename, 512); SENDPROCPARAM *pSendFileProcParam = new SENDPROCPARAM; pSendFileProcParam->dwIPOpposite = m_dwIPOpposite; pSendFileProcParam->iPort = SERVERPORT; pSendFileProcParam->hMainWnd = m_hWnd; pSendFileProcParam->strFileName = filename; pSendFileProcParam->piProcess = &m_iProcess; HANDLE hSendFileThread = CreateThread(NULL, 0, SendFileProc, (LPVOID)pSendFileProcParam, 0, NULL); CloseHandle(hSendFileThread); //close this handle to release its counter } DragFinish(hDropInfo); delete[] filename; CDialog::OnDropFiles(hDropInfo);}
开发者ID:rocflyhi,项目名称:glow,代码行数:31,
示例18: OnDropFilesvoid OnDropFiles(HDROP hDrop, HWND hDlg, thread_param* ptp){ struct CB cb; TCHAR FileName[MAXPATH]; DWORD i; DWORD FileNum; cb.cnt = 0; cb.filter = 0; cb.ptp = ptp; GetDlgItemText(hDlg, IDC_EXEPATH, g_ExePath, MAX_PATH); GetDlgItemText(hDlg, IDC_KEYPATH, g_KeyPath, MAX_PATH); if (!g_ExePath[0] || !g_KeyPath[0]) { AppendMsg(L"路径不合法/r/n"); return; } FileNum = DragQueryFile(hDrop, -1, NULL, 0); for (i=0; i<FileNum; ++i) { DragQueryFile(hDrop, i, (LPTSTR)FileName, MAXPATH); AppendFileToQueue(FileName, callback, &cb); } DragFinish(hDrop); return;}
开发者ID:Kerisa,项目名称:ExtractGames,代码行数:32,
示例19: SetActiveWindowvoid CMainFrame::OnDropFiles( HDROP hDropInfo ){ SetActiveWindow(); // activate us first ! CWinApp* pApp = AfxGetApp(); ASSERT(pApp != NULL); CString strFile; UINT nFilesCount=DragQueryFile(hDropInfo,INFINITE,NULL,0); for(UINT i=0; i<nFilesCount; i++) { int pathLen = DragQueryFile(hDropInfo, i, strFile.GetBuffer(MAX_PATH), MAX_PATH); strFile.ReleaseBuffer(pathLen); DWORD dwFileAttr = ::GetFileAttributes(strFile); if ((dwFileAttr & FILE_ATTRIBUTE_DIRECTORY)==FILE_ATTRIBUTE_DIRECTORY) { //目录,需要递归里面包含的文件 } else { CString strExt=strFile.Mid(strFile.GetLength()-4,4); if (strExt.CompareNoCase(_T(".xml"))==0) { pApp->OpenDocumentFile(strFile); } } } DragFinish(hDropInfo);}
开发者ID:ddcatgg,项目名称:duilib,代码行数:29,
示例20: STDMETHOD STDMETHOD (DragEnter) (LPDATAOBJECT pDataObject, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect) { AddRef(); m_filename[0] = 0; if (pDataObject) { FORMATETC fmte; fmte.cfFormat = CF_HDROP; fmte.ptd = NULL; fmte.dwAspect = DVASPECT_CONTENT; fmte.lindex = -1; fmte.tymed = TYMED_HGLOBAL; STGMEDIUM medium; if (SUCCEEDED(pDataObject->GetData(&fmte, &medium))) { HDROP hDrop = (HDROP)medium.hGlobal; m_filename[0] = 0; DragQueryFile(hDrop, 0, m_filename, sizeof(m_filename)); DragFinish(hDrop); m_flags = is_stylefile(m_filename) ? 2 : 0; } } *pdwEffect = DROPEFFECT_NONE; return S_OK; }
开发者ID:Jmos,项目名称:bbclean-xzero450,代码行数:26,
示例21: DragQueryFilechar *get_dragged_file(char *buffer, WPARAM wParam){ HDROP hDrop = (HDROP) wParam; buffer[0] = 0; DragQueryFile(hDrop, 0, buffer, MAX_PATH); DragFinish(hDrop); return buffer;}
开发者ID:rexwhitten,项目名称:bbclean-xzero450,代码行数:8,
示例22: OnDropFilesvoid OnDropFiles(HDROP hDrop){ char path[256]; DragQueryFile(hDrop, 0, path, sizeof(path)); DragFinish(hDrop); OpenMedia(path);}
开发者ID:vincent0629,项目名称:GoodMedia,代码行数:8,
示例23: NOTEPAD_OnDropFiles/*********************************************************************** * NOTEPAD_OnDropFiles * * WM_DROPFILES window message handle function * * ARGUMENTS: * - handle of window: * HWND hWnd * - drop info: * HDROP hDrop * RETURNS: none */static void NOTEPAD_OnDropFiles(HWND hWnd, HDROP hDrop){ char FileName[MAX_PATH]; //HANDLE hDrop = (HANDLE)wParam; DragQueryFile(hDrop, 0, FileName, ARRAY_SIZE(FileName)); DragFinish(hDrop); DoOpenFile(FileName);}
开发者ID:leavittx,项目名称:notepad,代码行数:21,
示例24: Notepad_OnDropFilesvoid Notepad_OnDropFiles(HWND hwnd, HDROP hDropInfo, char * filename ) { int nb, taille ; nb=DragQueryFile(hDropInfo, 0xFFFFFFFF, NULL, 0 ); if( nb> 0 ) { taille=DragQueryFile(hDropInfo, 0, NULL, 0 )+1; DragQueryFile(hDropInfo, 0, filename, taille ); } DragFinish(hDropInfo); }
开发者ID:tjyang,项目名称:kitty-remix,代码行数:9,
|