这篇教程C++ DeleteFileA函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DeleteFileA函数的典型用法代码示例。如果您正苦于以下问题:C++ DeleteFileA函数的具体用法?C++ DeleteFileA怎么用?C++ DeleteFileA使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DeleteFileA函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: DeleteFileAbool NFile::remove( Path filename ){#ifdef CAESARIA_PLATFORM_WIN BOOL result = DeleteFileA( filename.toString().c_str() ); if( !result ) { int error = GetLastError(); //Logger::warning( "Error[%d] on removed file %s", error, filename.toString().c_str() ); } return result;#elif defined(CAESARIA_PLATFORM_UNIX) || defined(CAESARIA_PLATFORM_HAIKU) int result = ::remove( filename.toString().c_str() ); return (result == 0);#endif}
开发者ID:KSLcom,项目名称:caesaria-game,代码行数:15,
示例2: CleanUpvoid CleanUp(HANDLE hFile){ if (CloseHandle(hFile) != TRUE) { Fail("GetFileSizeEx: ERROR -> Unable to close file /"%s/"./n" " Error is %d/n", szTextFile, GetLastError()); } if (!DeleteFileA(szTextFile)) { Fail("GetFileSizeEx: ERROR -> Unable to delete file /"%s/"./n" " Error is %d/n", szTextFile, GetLastError()); }}
开发者ID:0-wiz-0,项目名称:coreclr,代码行数:15,
示例3: poco_assertvoid FileImpl::removeImpl(){ poco_assert (!_path.empty()); if (isDirectoryImpl()) { if (RemoveDirectoryA(_path.c_str()) == 0) handleLastErrorImpl(_path); } else { if (DeleteFileA(_path.c_str()) == 0) handleLastErrorImpl(_path); }}
开发者ID:119,项目名称:vdc,代码行数:15,
示例4: mainint main(int argc, char *argv[]) { if (argc != 2 || stricmp(INSTALL_COMMAND, argv[1]) != 0 && stricmp(UNINSTALL_COMMAND, argv[1]) != 0) { MessageBoxA(NULL, "Usage:/n drvsetup install - install driver/n drvsetup uninstall - uninstall driver/n", "Information", MB_OK | MB_ICONINFORMATION); return 1; } if (stricmp(UNINSTALL_COMMAND, argv[1]) == 0) { UnregisterDriver(); char sysRoot[MAX_PATH]; char pathName[MAX_PATH]; GetEnvironmentVariableA("SYSTEMROOT", sysRoot, MAX_PATH); strncpy(pathName, sysRoot, MAX_PATH); strncat(pathName, "/SYSTEM32/mt32emu.dll", MAX_PATH); if (!DeleteFileA(pathName)) { // Driver can't be deleted, register pending deletion MoveFileExA(pathName, NULL, MOVEFILE_DELAY_UNTIL_REBOOT); } return 0; } char sysRoot[MAX_PATH]; char pathName[MAX_PATH]; char oldName[MAX_PATH]; GetEnvironmentVariableA("SYSTEMROOT", sysRoot, MAX_PATH); strncpy(pathName, sysRoot, MAX_PATH); strncat(pathName, "/SYSTEM32/mt32emu.dll", MAX_PATH); strncpy(oldName, sysRoot, MAX_PATH); strncat(oldName, "/SYSTEM32/mt32emu.old", MAX_PATH); DeleteFileA(oldName); MoveFileA(pathName, oldName); int setupPathLen = strrchr(argv[0], '//') - argv[0]; strncpy(oldName, argv[0], setupPathLen); oldName[setupPathLen] = 0; strncat(oldName, "/mt32emu.dll", MAX_PATH); CopyFileA(oldName, pathName, FALSE); RegisterDriver(); return 0;}
开发者ID:belaamg,项目名称:munt,代码行数:36,
示例5: cleanup_pid_filestatic void cleanup_pid_file(){ string pidfile = PID_FILE;#if defined(OS_WINDOWS_MOBILE) || defined(OS_WINDOWS_VISTA) wchar_t *wpidfile = strtowstr_alloc(pidfile.c_str()); if (wpidfile) { DeleteFile(wpidfile); free(wpidfile); }#elif defined(OS_WINDOWS) DeleteFileA(pidfile.c_str());#else unlink(pidfile.c_str());#endif}
开发者ID:zeeshanabid94,项目名称:ENCODERS,代码行数:15,
示例6: DeleteFileA// Removes object from disk and memorybool Cleaner::RemoveFile(QString filepath){ // use client0::RemoveFile return DeleteFileA(filepath.toAscii().constData());// if(removed)// {// WorkLog::GetLog().printmain(QString("object was successfully removed: ") + filepath);// } else // {// WorkLog::GetLog().printmain(QString("warning! Object was not removed: ") + filepath);// }}
开发者ID:burluckij,项目名称:unhooker,代码行数:16,
示例7: DeleteFileUTF8BOOL DeleteFileUTF8(LPCTSTR path){ if (WDL_HasUTF8(path) && GetVersion()< 0x80000000) { MBTOWIDE(wbuf,path); if (wbuf_ok) { BOOL rv=DeleteFileW(wbuf); MBTOWIDE_FREE(wbuf); return rv; } MBTOWIDE_FREE(wbuf); } return DeleteFileA(path);}
开发者ID:safetydank,项目名称:wdl-android,代码行数:15,
示例8: test_AdvInstallFilestatic void test_AdvInstallFile(void){ HRESULT hr; HMODULE hmod; char CURR_DIR[MAX_PATH]; char destFolder[MAX_PATH]; hmod = LoadLibrary("setupapi.dll"); if (!hmod) { skip("setupapi.dll not present/n"); return; } FreeLibrary(hmod); GetCurrentDirectoryA(MAX_PATH, CURR_DIR); lstrcpyA(destFolder, CURR_DIR); lstrcatA(destFolder, "//"); lstrcatA(destFolder, "dest"); createTestFile("source.txt"); /* try invalid source directory */ hr = pAdvInstallFile(NULL, NULL, "source.txt", destFolder, "destination.txt", 0, 0); ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %d/n", hr); ok(!DeleteFileA("dest//destination.txt"), "Expected dest//destination.txt to not exist/n"); /* try invalid source file */ hr = pAdvInstallFile(NULL, CURR_DIR, NULL, destFolder, "destination.txt", 0, 0); ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %d/n", hr); ok(!DeleteFileA("dest//destination.txt"), "Expected dest//destination.txt to not exist/n"); /* try invalid destination directory */ hr = pAdvInstallFile(NULL, CURR_DIR, "source.txt", NULL, "destination.txt", 0, 0); ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %d/n", hr); ok(!DeleteFileA("dest//destination.txt"), "Expected dest//destination.txt to not exist/n"); /* try copying to nonexistent destination directory */ hr = pAdvInstallFile(NULL, CURR_DIR, "source.txt", destFolder, "destination.txt", 0, 0); ok(hr == S_OK, "Expected S_OK, got %d/n", hr); ok(DeleteFileA("dest//destination.txt"), "Expected dest//destination.txt to exist/n"); /* native windows screws up if the source file doesn't exist */ /* test AIF_NOOVERWRITE behavior, asks the user to overwrite if AIF_QUIET is not specified */ createTestFile("dest//destination.txt"); hr = pAdvInstallFile(NULL, CURR_DIR, "source.txt", destFolder, "destination.txt", AIF_NOOVERWRITE | AIF_QUIET, 0); ok(hr == S_OK, "Expected S_OK, got %d/n", hr); ok(DeleteFileA("dest//destination.txt"), "Expected dest//destination.txt to exist/n"); ok(RemoveDirectoryA("dest"), "Expected dest to exist/n"); DeleteFileA("source.txt");}
开发者ID:bilboed,项目名称:wine,代码行数:56,
示例9: GetFullPathNameAvoid NetworkPacketDumper::deleteAdapterFiles() { std::list<NetworkAdapter*>::iterator it; for(it = adapterList.begin(); it != adapterList.end(); it++) { string adapterName = (*it)->getAdapterName(); char* szLogFileName = new char[1024]; string logName = "logs//"; logName += adapterName; logName += ".pcap"; GetFullPathNameA(logName.c_str(), 1024, szLogFileName, NULL); LOG(INFO, "NetworkdPacketDumper: deleting log files %s",logName.c_str()); DeleteFileA(szLogFileName); delete [] szLogFileName; } }
开发者ID:340211173,项目名称:capture-hpc,代码行数:16,
示例10: _tmainint _tmain(int argc, _TCHAR* argv[]){ if (argc > 1 && argv[1]) { char path[1000] {}; WideCharToMultiByte(CP_UTF8, 0, argv[1], -1, path, 1000, 0, 0); std::string out(path); out.append(".temp"); if (MoveFileA(path, out.c_str()) == TRUE) { Parse(out, path); DeleteFileA(out.c_str()); } } return 0;}
开发者ID:jaylauffer,项目名称:loadngo,代码行数:16,
示例11: SvcCtrlHandlervoid WINAPI SvcCtrlHandler(DWORD dwCtrl){ switch (dwCtrl) { case SERVICE_CONTROL_STOP: ReportSvcStatus(SERVICE_STOP_PENDING, NO_ERROR, 0); DeleteFileA("////.//pipe//TagServicePipe"); SetEvent(ghSvcStopEvent); return; case SERVICE_CONTROL_INTERROGATE: break; default: break; }}
开发者ID:Jereq,项目名称:TagSystem,代码行数:17,
示例12: SetAvatarstatic void SetAvatar(HANDLE hContact, JABBER_LIST_ITEM *item, char *data, int len, DWORD format) { FILE* out; char filename[MAX_PATH]; char md5[33]; MD5 context; int i; md5_init(&context); md5_update(&context, data, len); md5_finalize(&context); if (format == PA_FORMAT_UNKNOWN && len > 4) { format = JabberGetPictureType(data); } for (i=0;i<16;i++) { char lo, hi; unsigned int j=context.state[i>>2]; j>>=8*(i%4); j&=0xFF; lo = j & 0x0F; hi = j >> 4; hi = hi + ((hi > 9) ? 'a' - 10 : '0'); lo = lo + ((lo > 9) ? 'a' - 10 : '0'); md5[i*2] = hi; md5[i*2+1] = lo; } md5[i*2] = 0; if (item != NULL) { char *hash = item->avatarHash; item->avatarFormat = format; item->avatarHash = mir_strdup(md5); mir_free(hash); } else { jabberThreadInfo->avatarFormat = format; strcpy(jabberThreadInfo->avatarHash, md5); } TlenGetAvatarFileName(item, filename, sizeof filename ); DeleteFileA(filename); out = fopen( filename, "wb" ); if ( out != NULL ) { fwrite( data, len, 1, out ); fclose( out ); DBWriteContactSettingString(hContact, "ContactPhoto", "File", filename ); DBWriteContactSettingString(hContact, jabberProtoName, "AvatarHash", md5); DBWriteContactSettingDword(hContact, jabberProtoName, "AvatarFormat", format); } ProtoBroadcastAck( jabberProtoName, hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL , 0);}
开发者ID:BackupTheBerlios,项目名称:mtlen-svn,代码行数:46,
示例13: CleanUpBOOL CleanUp(HANDLE hFile, const char * fileName){ BOOL bRc = TRUE; if (CloseHandle(hFile) != TRUE) { bRc = FALSE; Trace("WriteFile: ERROR -> Unable to close file /"%s/"," " error: %ld./n", fileName, GetLastError()); } if (!DeleteFileA(fileName)) { bRc = FALSE; Trace("WriteFile: ERROR -> Unable to delete file /"%s/"," " error: %ld./n", fileName, GetLastError()); } return bRc;}
开发者ID:smartmaster,项目名称:sscli,代码行数:17,
示例14: CleanupBOOL Cleanup(void){ char FileName[20]; int i; BOOL bRet = TRUE; // assume success // loop through all accesses, modes, dispositions and flags for (i=0; i<4*8*4*5; ++i) { sprintf(FileName, "test%03d.txt", i); if (DeleteFileA(FileName) == FALSE) { if (GetLastError() != ERROR_FILE_NOT_FOUND) { bRet = FALSE; } } } return bRet;}
开发者ID:smartmaster,项目名称:sscli,代码行数:17,
示例15: getSystemType //-------------------------------- bool Utils::deleteFile(const String &pathString) { SystemType type = getSystemType();#ifdef COLLADABU_OS_WIN if (type != WINDOWS) return false; return DeleteFileA(pathString.c_str()) != FALSE;#else if (type != POSIX) return false; char command[4097]; sprintf(command, "rm -f /"%s/"", pathString.c_str()); int status = system(command); return status == 0;#endif }
开发者ID:Fredounet,项目名称:OpenCOLLADA,代码行数:18,
示例16: Cleanupstatic void Cleanup(HANDLE hFile){ if (!CloseHandle(hFile)) { Trace("SetEndOfFile: ERROR -> Unable to close file /"%s/". ", "GetLastError returned %u./n", szTextFile, GetLastError()); } if (!DeleteFileA(szTextFile)) { Trace("SetEndOfFile: ERROR -> Unable to delete file /"%s/". ", "GetLastError returned %u./n", szTextFile, GetLastError()); }}
开发者ID:0-wiz-0,项目名称:coreclr,代码行数:17,
示例17: removebool remove(const u::string &path, pathType type) { u::string &&fix = u::fixPath(path); if (type == kFile) {#if defined(_WIN32) return DeleteFileA(&fix[0]) != 0;#else return ::remove(&fix[0]) == 0;#endif } // type == kDirectory#if defined(_WIN32) return RemoveDirectoryA(&fix[0]) != 0;#else return ::rmdir(&fix[0]) == 0;#endif}
开发者ID:dreamsxin,项目名称:neothyne,代码行数:17,
示例18: optk_unlink/* * Removes a directory entry. */intoptk_unlink(const char *path){#if defined OPTK_OS_WINDOWS return DeleteFileA(path) ? 0 : -1;#elif defined OPTK_OS_UNIX || defined OPTK_OS_DOSISH return unlink(path);#else /* generic */ return remove(path);#endif}
开发者ID:OscarLeif,项目名称:sprite-sheet-packer,代码行数:20,
示例19: CCASSERTbool FileUtils::renameFile(const std::string &path, const std::string &oldname, const std::string &name){ CCASSERT(!path.empty(), "Invalid path"); std::string oldPath = path + oldname; std::string newPath = path + name; // Rename a file#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT || CC_TARGET_PLATFORM == CC_PLATFORM_WP8) std::regex pat("///"); std::string _old = std::regex_replace(oldPath, pat, "//"); std::string _new = std::regex_replace(newPath, pat, "//"); if (MoveFileEx(std::wstring(_old.begin(), _old.end()).c_str(), std::wstring(_new.begin(), _new.end()).c_str(), MOVEFILE_REPLACE_EXISTING & MOVEFILE_WRITE_THROUGH)) { return true; } return false;#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) std::regex pat("///"); std::string _old = std::regex_replace(oldPath, pat, "//"); std::string _new = std::regex_replace(newPath, pat, "//"); if(FileUtils::getInstance()->isFileExist(_new)) { DeleteFileA(_new.c_str()); } MoveFileA(_old.c_str(), _new.c_str()); if (0 == GetLastError()) return true; else return false;#else int errorCode = rename(oldPath.c_str(), newPath.c_str()); if (0 != errorCode) { CCLOGERROR("Fail to rename file %s to %s !Error code is %d", oldPath.c_str(), newPath.c_str(), errorCode); return false; } return true;#endif}
开发者ID:chenquanjun,项目名称:Cocos2dxResourceEncrypt,代码行数:45,
示例20: UninstallDllFromSystem32bool UninstallDllFromSystem32(char *dst_filename){ char system32[MAX_PATH]; char dst_fullpath[MAX_PATH]; char bak_fullpath[MAX_PATH]; bool ret; if (Is64BitCode() || IsWow64() == false) { GetSystemDirectoryA(system32, sizeof(system32)); } else { GetSystemWow64DirectoryA(system32, sizeof(system32)); } SeStrCpy(dst_fullpath, sizeof(dst_fullpath), system32); SeStrCat(dst_fullpath, sizeof(dst_fullpath), "//"); SeStrCat(dst_fullpath, sizeof(dst_fullpath), dst_filename); SeStrCpy(bak_fullpath, sizeof(bak_fullpath), dst_fullpath); SeStrCat(bak_fullpath, sizeof(bak_fullpath), ".bak");LABEL_RETRY: ret = DeleteFileA(dst_fullpath); if (ret == false) { char tmp[MAX_SIZE]; wsprintfA(tmp, "Deleting the file /"%s/" failed./r/n/r/n" "Make sure that there are no running programs using WinPcap DLL.", dst_fullpath); if (MessageBoxA(NULL, tmp, INSTALLER_TITLE, MB_ICONEXCLAMATION | MB_SYSTEMMODAL | MB_RETRYCANCEL) == IDRETRY) { goto LABEL_RETRY; } return false; } MoveFileA(bak_fullpath, dst_fullpath); return true;}
开发者ID:AmesianX,项目名称:Win10Pcap,代码行数:45,
示例21: test_SetupGetSourceInfostatic void test_SetupGetSourceInfo(void){ char buffer[MAX_PATH], inf_filename[MAX_PATH]; DWORD required; HINF hinf; BOOL ret; lstrcpyA(inf_filename, CURR_DIR); lstrcatA(inf_filename, "//"); lstrcatA(inf_filename, "test.inf"); create_inf_file(inf_filename, inf_data1, sizeof(inf_data1) - 1); hinf = SetupOpenInfFileA(inf_filename, NULL, INF_STYLE_WIN4, NULL); ok(hinf != INVALID_HANDLE_VALUE, "could not open inf file/n"); required = 0; ret = SetupGetSourceInfoA(hinf, 2, SRCINFO_PATH, buffer, sizeof(buffer), &required); ok(ret, "SetupGetSourceInfoA failed/n"); ok(required == 1, "unexpected required size: %d/n", required); ok(!lstrcmpA("", buffer), "unexpected result string: %s/n", buffer); required = 0; buffer[0] = 0; ret = SetupGetSourceInfoA(hinf, 2, SRCINFO_TAGFILE, buffer, sizeof(buffer), &required); ok(ret, "SetupGetSourceInfoA failed/n"); ok(required == 28, "unexpected required size: %d/n", required); ok(!lstrcmpA("LANCOM//LANtools//lanconf.cab", buffer), "unexpected result string: %s/n", buffer); required = 0; buffer[0] = 0; ret = SetupGetSourceInfoA(hinf, 2, SRCINFO_DESCRIPTION, buffer, sizeof(buffer), &required); ok(ret, "SetupGetSourceInfoA failed/n"); ok(required == 19, "unexpected required size: %d/n", required); ok(!lstrcmpA("LANCOM Software CD", buffer), "unexpected result string: %s/n", buffer); SetupCloseInfFile(hinf); DeleteFileA(inf_filename);}
开发者ID:bilboed,项目名称:wine,代码行数:45,
示例22: test_enum_procstatic BOOL WINAPI test_enum_proc(HMODULE module, LPCSTR type, LPSTR name, LONG_PTR param){ const char *script_data, *ext; DWORD script_size, size; char file_name[MAX_PATH]; HANDLE file; HRSRC src; BOOL res; trace("running %s test.../n", name); src = FindResourceA(NULL, name, type); ok(src != NULL, "Could not find resource %s: %u/n", name, GetLastError()); if(!src) return TRUE; script_data = LoadResource(NULL, src); script_size = SizeofResource(NULL, src); while(script_size && !script_data[script_size-1]) script_size--; ext = strrchr(name, '.'); ok(ext != NULL, "no script extension/n"); if(!ext) return TRUE; sprintf(file_name, "test%s", ext); file = CreateFileA(file_name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u/n", GetLastError()); if(file == INVALID_HANDLE_VALUE) return TRUE; res = WriteFile(file, script_data, script_size, &size, NULL); CloseHandle(file); ok(res, "Could not write to file: %u/n", GetLastError()); if(!res) return TRUE; run_test(file_name); DeleteFileA(file_name); return TRUE;}
开发者ID:Dimillian,项目名称:wine,代码行数:45,
示例23: file_deleteint file_delete(std::string fname) { DWORD result = DeleteFileA(fname.c_str()); switch(result) { case 0: return 0; break; case ERROR_FILE_NOT_FOUND: return 0; break; case ERROR_ACCESS_DENIED: return 0; break; default: return 1; break; }}
开发者ID:DarkAceZ,项目名称:enigma-dev,代码行数:18,
示例24: test_simple_enumerationAstatic void test_simple_enumerationA(void){ BOOL ret; char source[MAX_PATH], temp[MAX_PATH]; int enum_count = 0; GetTempPathA(sizeof(temp), temp); GetTempFileNameA(temp, "doc", 0, source); create_source_fileA(source, comp_cab_zip_multi, sizeof(comp_cab_zip_multi)); ret = SetupIterateCabinetA(source, 0, simple_callbackA, &enum_count); ok(ret == 1, "Expected SetupIterateCabinetA to return 1, got %d/n", ret); ok(enum_count == sizeof(expected_files)/sizeof(char *), "Unexpectedly enumerated %d files/n", enum_count); DeleteFileA(source);}
开发者ID:DeltaYang,项目名称:wine,代码行数:18,
示例25: removebool remove(const path & p) { bool succeeded = true; if(is_directory(p)) { succeeded &= RemoveDirectoryA(p.string().c_str()) == TRUE; if(!succeeded) { LogWarning << "RemoveDirectoryA(" << p << ") failed! " << GetLastErrorString(); } } else { succeeded &= DeleteFileA(p.string().c_str()) == TRUE; if(!succeeded) { LogWarning << "DeleteFileA(" << p << ") failed! " << GetLastErrorString(); } } return succeeded;}
开发者ID:DaveMachine,项目名称:ArxLibertatis,代码行数:18,
示例26: optk_rename/* * Changes the name of a file path. */intoptk_rename(const char *src_path, const char *dest_path, int clobber){#if defined OPTK_OS_WINDOWS DWORD dwFlags;#if !defined OPTK_OS_WIN64 if (OPTK_OS_WINDOWS_IS_WIN9X()) { /* MoveFileEx is not available under Win9X; use MoveFile. */ if (MoveFileA(src_path, dest_path)) return 0; if (!clobber) return -1; DeleteFileA(dest_path); return MoveFileA(src_path, dest_path) ? 0 : -1; }#endif dwFlags = clobber ? MOVEFILE_REPLACE_EXISTING : 0; return MoveFileExA(src_path, dest_path, dwFlags) ? 0 : -1;#elif defined OPTK_OS_UNIX if (!clobber) { if (access(dest_path, OPTK_TEST_FILE) >= 0) return -1; } return rename(src_path, dest_path);#else /* generic */ if (optk_test(dest_path, "e") > 0) { if (!clobber) return -1; optk_unlink(dest_path); } return rename(src_path, dest_path);#endif}
开发者ID:OscarLeif,项目名称:sprite-sheet-packer,代码行数:47,
示例27: mWinMainint WINAPI mWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdParam, int iCmdShow){ //if (!stricmp(szCmdParam, "-n")) //phc //editnpc = 1; //if (!stricmp(szCmdParam, "-r")) //phc random = 1; //phc // First check to see if the file exists. // while (GetFileAttributesA("cityofheroes.exe") == INVALID_FILE_ATTRIBUTES) { PromptUserForCohLocation(); } STARTUPINFO startup; memset(&startup, 0, sizeof(startup)); startup.cb = sizeof(STARTUPINFO); memset(&pinfo, 0, sizeof(pinfo)); if(!CreateProcessA("cityofheroes.exe", "cityofheroes.exe -project coh -noverify", NULL, NULL, FALSE, CREATE_NEW_PROCESS_GROUP | CREATE_SUSPENDED | DETACHED_PROCESS, NULL, NULL, (LPSTARTUPINFOA)&startup, &pinfo)) { MessageBoxA(NULL, "Failed to launch process!", "Error", MB_OK | MB_ICONEXCLAMATION); return 0; } // delete old crap previous version used BOOL blAtr = GetFileAttributesA("data//charcreate.txt"); if (blAtr) DeleteFileA("data//charcreate.txt"); RunPatch(); //Inject my Dll DWORD dwPID = pinfo.dwProcessId ; m_hTargetProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwPID); InjectDLL(_T("HookCostume.dll")); CloseHandle(m_hTargetProcess); ResumeThread(pinfo.hThread); return 0;}
开发者ID:ChristopherViola,项目名称:HeroVirtualTabletop,代码行数:43,
示例28: DestroyDirectoryA /* * DestroyDirectoryA * WinAPI-like function that deletes the path @szPath fully */ inline BOOL DestroyDirectoryA(LPCTSTR szPath) { ForeachFile(szPath, "*.*", false, [&szPath](ModLoaderFile& file) { CHAR szPathFile[MAX_PATH]; const char* pPath = file.filename; sprintf(szPathFile, "%s//%s", szPath, pPath); if(file.is_dir) DestroyDirectoryA(szPathFile); else DeleteFileA(szPathFile); return TRUE; }); return RemoveDirectoryA(szPath); }
开发者ID:Whitetigerswt,项目名称:sa-modloader,代码行数:23,
示例29: DumpCombovoid DumpCombo (HWND hComboBox, int bClear){ FILE *f; int i, nComboIdx[SIZEOF_MRU_LIST]; if (bClear) { DeleteFileA (GetConfigPath (TC_APPD_FILENAME_HISTORY)); return; } f = fopen (GetConfigPath (TC_APPD_FILENAME_HISTORY), "w"); if (f == NULL) return; XmlWriteHeader (f); fputs ("/n/t<history>", f); /* combo list part:- get mru items */ for (i = 0; i < SIZEOF_MRU_LIST; i++) nComboIdx[i] = GetOrderComboIdx (hComboBox, &nComboIdx[0], i); /* combo list part:- write out mru items */ for (i = 0; i < SIZEOF_MRU_LIST; i++) { char szTmp[MAX_PATH] = { 0 }; if (SendMessage (hComboBox, CB_GETLBTEXTLEN, nComboIdx[i], 0) < sizeof (szTmp)) SendMessage (hComboBox, CB_GETLBTEXT, nComboIdx[i], (LPARAM) & szTmp[0]); if (szTmp[0] != 0) { char q[MAX_PATH * 2] = { 0 }; XmlQuoteText (szTmp, q, sizeof (q)); fprintf (f, "/n/t/t<volume>%s</volume>", q); } } fputs ("/n/t</history>", f); XmlWriteFooter (f); fclose (f);}
开发者ID:shimbongsu,项目名称:secure-share-fss,代码行数:42,
注:本文中的DeleteFileA函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ DeleteFileW函数代码示例 C++ DeleteFile函数代码示例 |