• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PointToName函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中PointToName函数的典型用法代码示例。如果您正苦于以下问题:C++ PointToName函数的具体用法?C++ PointToName怎么用?C++ PointToName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了PointToName函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetFilePath

// Returns file path including the trailing path separator symbol.
void GetFilePath(const wchar *FullName,wchar *Path,size_t MaxLength)
{
  if (MaxLength==0)
    return;
  size_t PathLength=Min(MaxLength-1,size_t(PointToName(FullName)-FullName));
  wcsncpy(Path,FullName,PathLength);
  Path[PathLength]=0;
}
开发者ID:KyleSanderson,项目名称:mpc-hc,代码行数:9,代码来源:pathfn.cpp


示例2: return

bool ScanTree::PrepareMasks()
{
  if (!FileMasks->GetString(CurMask,CurMaskW,sizeof(CurMask)))
    return(false);
#ifdef _WIN_32
  UnixSlashToDos(CurMask);
#endif
  char *Name=PointToName(CurMask);
  if (*Name==0)
    strcat(CurMask,MASKALL);
  if (Name[0]=='.' && (Name[1]==0 || Name[1]=='.' && Name[2]==0))
  {
    AddEndSlash(CurMask);
    strcat(CurMask,MASKALL);
  }
  SpecPathLength=Name-CurMask;
//  if (SpecPathLength>1)
//    SpecPathLength--;

  bool WideName=(*CurMaskW!=0);

  if (WideName)
  {
    wchar *NameW=PointToName(CurMaskW);
    if (*NameW==0)
      strcatw(CurMaskW,MASKALLW);
    if (NameW[0]=='.' && (NameW[1]==0 || NameW[1]=='.' && NameW[2]==0))
    {
      AddEndSlash(CurMaskW);
      strcatw(CurMaskW,MASKALLW);
    }
    SpecPathLengthW=NameW-CurMaskW;
  }
  else
  {
    wchar WideMask[NM];
    CharToWide(CurMask,WideMask);
    SpecPathLengthW=PointToName(WideMask)-WideMask;
  }
  Depth=0;

  strcpy(OrigCurMask,CurMask);
  strcpyw(OrigCurMaskW,CurMaskW);

  return(true);
}
开发者ID:Akkarinage,项目名称:Neoncube,代码行数:46,代码来源:scantree.cpp


示例3: PointToExt

// Возвращает ".ext" или NULL в случае ошибки
const wchar_t* PointToExt(const wchar_t* asFullPath)
{
	const wchar_t* pszName = PointToName(asFullPath);
	if (!pszName)
		return NULL; // _ASSERTE уже был
	const wchar_t* pszExt = wcsrchr(pszName, L'.');
	return pszExt;
}
开发者ID:EdSchroedinger,项目名称:ConEmu,代码行数:9,代码来源:CmdLine.cpp


示例4: DownloadFile

	UINT DownloadFile(LPCWSTR asSource, LPCWSTR asTarget, DWORD& crc, DWORD& size, BOOL abShowAllErrors = FALSE)
	{
		UINT iRc = E_UNEXPECTED;
		UINT nWait;
		wchar_t* pszCommand = NULL;
		wchar_t* szCmdDirectory = NULL; // Destination directory for file creation

		MCHKHEAP;

		// Split target into directory and file-name
		LPCWSTR pszName = PointToName(asTarget);
		if (pszName > asTarget)
		{
			szCmdDirectory = lstrdup(asTarget);
			if (!szCmdDirectory)
			{
				iRc = E_OUTOFMEMORY;
				goto wrap;
			}
			szCmdDirectory[pszName-asTarget] = 0;
		}

		// Prepare command line for downloader tool
		pszCommand = CreateCommand(asSource, pszName, iRc);
		if (!pszCommand)
		{
			_ASSERTE(iRc!=0);
			goto wrap;
		}

		_ASSERTE(m_PI.hProcess==NULL);
		MCHKHEAP;

		nWait = ExecuteDownloader(pszCommand, szCmdDirectory);

		// Now check the result of downloader proc
		if (nWait != 0)
		{
			iRc = nWait;
			goto wrap;
		}

		if (!CalcFileHash(asTarget, size, crc))
		{
			iRc = GetLastError();
			if (!iRc)
				iRc = E_UNEXPECTED;
			goto wrap;
		}

		iRc = 0; // OK
	wrap:
		MCHKHEAP;
		SafeFree(pszCommand);
		SafeFree(szCmdDirectory);
		CloseHandles();
		return iRc;
	};
开发者ID:1833183060,项目名称:ConEmu,代码行数:58,代码来源:DownloaderCall.cpp


示例5: lsLogPath

void CSetPgFeatures::UpdateLogLocation()
{
	// Cut log file to directory only
	CEStr lsLogPath(gpSet->GetLogFileName());
	LPCWSTR pszName = lsLogPath.IsEmpty() ? NULL : PointToName(lsLogPath.ms_Val);
	if (pszName)
		*(wchar_t*)pszName = 0;
	SetDlgItemText(gpSetCls->GetPage(thi_Features), tDebugLogDir, lsLogPath);
}
开发者ID:1833183060,项目名称:ConEmu,代码行数:9,代码来源:SetPgFeatures.cpp


示例6: CmpName

// IS: функция для внешнего мира, использовать ее
int CmpName(const wchar_t *pattern,const wchar_t *str, bool skippath, bool CmpNameSearchMode)
{
	if (!pattern || !str)
		return FALSE;

	if (skippath)
		str=PointToName(str);

	return CmpName_Body(pattern,str,CmpNameSearchMode);
}
开发者ID:Maximus5,项目名称:Far3bis,代码行数:11,代码来源:processname.cpp


示例7: uiAskReplaceEx

// Additionally to handling user input, it analyzes and sets command options.
// Returns only 'replace', 'skip' and 'cancel' codes.
UIASKREP_RESULT uiAskReplaceEx(RAROptions *Cmd,wchar *Name,size_t MaxNameSize,int64 FileSize,RarTime *FileTime,uint Flags)
{
  if (Cmd->Overwrite==OVERWRITE_NONE)
    return UIASKREP_R_SKIP;

#if !defined(SFX_MODULE) && !defined(SILENT)
  // Must be before Cmd->AllYes check or -y switch would override -or.
  if (Cmd->Overwrite==OVERWRITE_AUTORENAME && GetAutoRenamedName(Name,MaxNameSize))
    return UIASKREP_R_REPLACE;
#endif

  // This check must be after OVERWRITE_AUTORENAME processing or -y switch
  // would override -or.
  if (Cmd->AllYes || Cmd->Overwrite==OVERWRITE_ALL)
  {
    PrepareToDelete(Name);
    return UIASKREP_R_REPLACE;
  }

  wchar NewName[NM];
  wcsncpyz(NewName,Name,ASIZE(NewName));
  UIASKREP_RESULT Choice=uiAskReplace(NewName,ASIZE(NewName),FileSize,FileTime,Flags);

  if (Choice==UIASKREP_R_REPLACE || Choice==UIASKREP_R_REPLACEALL)
    PrepareToDelete(Name);

  if (Choice==UIASKREP_R_REPLACEALL)
  {
    Cmd->Overwrite=OVERWRITE_ALL;
    return UIASKREP_R_REPLACE;
  }
  if (Choice==UIASKREP_R_SKIPALL)
  {
    Cmd->Overwrite=OVERWRITE_NONE;
    return UIASKREP_R_SKIP;
  }
  if (Choice==UIASKREP_R_RENAME)
  {
    if (PointToName(NewName)==NewName)
      SetName(Name,NewName,MaxNameSize);
    else
      wcsncpyz(Name,NewName,MaxNameSize);
    if (FileExist(Name))
      return uiAskReplaceEx(Cmd,Name,MaxNameSize,FileSize,FileTime,Flags);
    return UIASKREP_R_REPLACE;
  }
#if !defined(SFX_MODULE) && !defined(SILENT)
  if (Choice==UIASKREP_R_RENAMEAUTO && GetAutoRenamedName(Name,MaxNameSize))
  {
    Cmd->Overwrite=OVERWRITE_AUTORENAME;
    return UIASKREP_R_REPLACE;
  }
#endif
  return Choice;
}
开发者ID:1ldk,项目名称:mpc-hc,代码行数:57,代码来源:uicommon.cpp


示例8: RemoveOldComSpecC

void RemoveOldComSpecC()
{
	wchar_t szComSpec[MAX_PATH], szComSpecC[MAX_PATH], szRealComSpec[MAX_PATH];
	//110202 - comspec более не переопределяется, поэтому вернем "cmd",
	// если был переопреден и унаследован от старой версии conemu
	if (GetEnvironmentVariable(L"ComSpecC", szComSpecC, countof(szComSpecC)) && szComSpecC[0] != 0)
	{
		szRealComSpec[0] = 0;

		if (!GetEnvironmentVariable(L"ComSpec", szComSpec, countof(szComSpec)))
			szComSpec[0] = 0;

		#ifndef __GNUC__
		#pragma warning( push )
		#pragma warning(disable : 6400)
		#endif

		LPCWSTR pwszName = PointToName(szComSpec);

		if (lstrcmpiW(pwszName, L"ConEmuC.exe")==0 || lstrcmpiW(pwszName, L"ConEmuC64.exe")==0)
		{
			pwszName = PointToName(szComSpecC);
			if (lstrcmpiW(pwszName, L"ConEmuC.exe")!=0 && lstrcmpiW(pwszName, L"ConEmuC64.exe")!=0)
			{
				wcscpy_c(szRealComSpec, szComSpecC);
			}
		}
		#ifndef __GNUC__
		#pragma warning( pop )
		#endif

		if (szRealComSpec[0] == 0)
		{
			//\system32\cmd.exe
			GetComspecFromEnvVar(szRealComSpec, countof(szRealComSpec));
		}

		SetEnvironmentVariable(L"ComSpec", szRealComSpec);
		SetEnvironmentVariable(L"ComSpecC", NULL);
	}
}
开发者ID:Alexander-Shukaev,项目名称:ConEmu,代码行数:41,代码来源:WUser.cpp


示例9: CDefTermBase

CDefTermHk::CDefTermHk()
	: CDefTermBase(false)
{
	mh_StopEvent = CreateEvent(NULL, TRUE, FALSE, NULL);

	wchar_t szSelfName[MAX_PATH+1] = L"";
	GetModuleFileName(NULL, szSelfName, countof(szSelfName));
	lstrcpyn(ms_ExeName, PointToName(szSelfName), countof(ms_ExeName));

	mn_LastCheck = 0;
	ReloadSettings();
}
开发者ID:aaronrl,项目名称:ConEmu,代码行数:12,代码来源:DefTermHk.cpp


示例10: IsFarExe

bool IsFarExe(LPCWSTR asModuleName)
{
	if (asModuleName && *asModuleName)
	{
		LPCWSTR pszName = PointToName(asModuleName);
		if (lstrcmpi(pszName, L"far.exe") == 0 || lstrcmpi(pszName, L"far") == 0
			|| lstrcmpi(pszName, L"far64.exe") == 0 || lstrcmpi(pszName, L"far64") == 0)
		{
			return true;
		}
	}
	return false;
}
开发者ID:shdrach,项目名称:ConEmu,代码行数:13,代码来源:CmdLine.cpp


示例11: UpdateExistingShortName

bool UpdateExistingShortName(char *Name,wchar *NameW)
{
  FindData fd;
  if (!FindFile::FastFind(Name,NameW,&fd))
    return(false);
  if (*fd.Name==0 || *fd.ShortName==0)
    return(false);
  if (stricomp(PointToName(fd.Name),fd.ShortName)==0 ||
      stricomp(PointToName(Name),fd.ShortName)!=0)
    return(false);

  char NewName[NM];
  for (int I=0;I<10000;I+=123)
  {
    strncpyz(NewName,Name,ASIZE(NewName));
    sprintf(PointToName(NewName),"rtmp%d",I);
    if (!FileExist(NewName))
      break;
  }
  if (FileExist(NewName))
    return(false);
  char FullName[NM];
  strncpyz(FullName,Name,ASIZE(FullName));
  strcpy(PointToName(FullName),PointToName(fd.Name));
  if (!MoveFile(FullName,NewName))
    return(false);
  File KeepShortFile;
  bool Created=false;
  if (!FileExist(Name))
    Created=KeepShortFile.Create(Name);
  MoveFile(NewName,FullName);
  if (Created)
  {
    KeepShortFile.Close();
    KeepShortFile.Delete();
  }
  return(true);
}
开发者ID:9a3eedi,项目名称:Droidsound,代码行数:38,代码来源:filcreat.cpp


示例12: MakeNameUsable

void MakeNameUsable(char *Name, bool bKeepExtension, bool IsFATX)
{
  // Changed to be compatible with xbmc's MakeLegalFileName function
  // (xbox only)

  if ( Name == NULL) return;
  char cIllegalChars[] = "<>=?;\"*+,/|";
  unsigned int iIllegalCharSize = strlen(cIllegalChars);
  bool isIllegalChar;
  unsigned int iSize = strlen(Name);
  unsigned int iNewStringSize = 0;
  char* strNewString = new char[iSize + 1];

  // only copy the legal characters to the new filename
  for (unsigned int i = 0; i < iSize; i++)
  {
    isIllegalChar = false;
    // check for illigal chars
    for (unsigned j = 0; j < iIllegalCharSize; j++)
      if (Name[i] == cIllegalChars[j]) isIllegalChar = true;
    // FATX only allows chars from 32 till 127
    if (isIllegalChar == false &&
        Name[i] > 31 && Name[i] < 127) strNewString[iNewStringSize++] = Name[i];
  }
  strNewString[iNewStringSize] = '\0';

  if (IsFATX)
  {
    // since we can only write to samba shares and hd, we assume this has to be a fatx filename
    // thus we have to strip it down to 42 chars (samba doesn't have this limitation)
  
    char* FileName = PointToName(strNewString);
    int iFileNameSize = strlen(FileName);
    // no need to keep the extension, just strip it down to 42 characters
    if (iFileNameSize > 42 && bKeepExtension == false) FileName[42] = '\0';

    // we want to keep the extension
    else if (iFileNameSize > 42 && bKeepExtension == true)
    {
      char strExtension[42];
      unsigned int iExtensionLength = iFileNameSize - (strrchr(FileName, '.') - FileName);
      strcpy(strExtension, (FileName + iFileNameSize - iExtensionLength));

      strcpy(FileName + (42 - iExtensionLength), strExtension);
    }
  }

  strcpy(Name, strNewString);
  delete[] strNewString;
}
开发者ID:1ibraheem,项目名称:xbmc,代码行数:50,代码来源:pathfn.cpp


示例13: CmpName

bool CmpName(char *Wildcard,char *Name,int CmpPath)
{
  if (CmpPath!=MATCH_NAMES)
  {
    int WildLength=strlen(Wildcard);
    if (CmpPath!=MATCH_EXACTPATH && strnicompc(Wildcard,Name,WildLength)==0)
    {
      char NextCh=Name[WildLength];
      if (NextCh=='\\' || NextCh=='/' || NextCh==0)
        return(true);
    }
    char Path1[NM],Path2[NM];
    GetFilePath(Wildcard,Path1);
    GetFilePath(Name,Path2);
    if (stricompc(Wildcard,Path2)==0)
      return(true);
    if ((CmpPath==MATCH_PATH || CmpPath==MATCH_EXACTPATH) && stricompc(Path1,Path2)!=0)
      return(false);
    if (CmpPath==MATCH_SUBPATH || CmpPath==MATCH_WILDSUBPATH)
      if (IsWildcard(Path1))
        return(match(Wildcard,Name));
      else
        if (CmpPath==MATCH_SUBPATH || IsWildcard(Wildcard))
        {
          if (*Path1 && strnicompc(Path1,Path2,strlen(Path1))!=0)
            return(false);
        }
        else
          if (stricompc(Path1,Path2)!=0)
            return(false);
  }
  char *Name1=PointToName(Wildcard);
  char *Name2=PointToName(Name);
  if (strnicompc("__rar_",Name2,6)==0)
    return(false);
  return(match(Name1,Name2));
}
开发者ID:stahta01,项目名称:wxCode_components,代码行数:37,代码来源:match.cpp


示例14: assign

void Panel::DragMessage(int X,int Y,int Move)
{
	const auto SelCount = SrcDragPanel->GetSelCount();

	if (!SelCount)
		return;

	string strSelName;

	if (SelCount == 1)
	{
		os::fs::find_data Data;
		if (!SrcDragPanel->get_first_selected(Data))
			return;

		assign(strSelName, PointToName(Data.FileName));
		QuoteSpace(strSelName);
	}
	else
	{
		strSelName = format(msg(lng::MDragFiles), SelCount);
	}

	auto strDragMsg = format(msg(Move? lng::MDragMove : lng::MDragCopy), strSelName);

	auto Length = static_cast<int>(strDragMsg.size());
	int MsgX = X;

	if (Length + X > ScrX)
	{
		MsgX=ScrX-Length;

		if (MsgX<0)
		{
			MsgX=0;
			TruncStrFromEnd(strDragMsg,ScrX);
			Length=(int)strDragMsg.size();
		}
	}

	SCOPED_ACTION(ChangePriority)(THREAD_PRIORITY_NORMAL);
	// Important - the old one must be deleted before creating a new one, not after
	DragSaveScr.reset();
	DragSaveScr = std::make_unique<SaveScreen>(MsgX, Y, MsgX + Length - 1, Y);
	GotoXY(MsgX,Y);
	SetColor(COL_PANELDRAGTEXT);
	Text(strDragMsg);
}
开发者ID:johnd0e,项目名称:farmanager,代码行数:48,代码来源:panel.cpp


示例15: GetProcessInfo

bool GetProcessInfo(LPCWSTR asExeName, PROCESSENTRY32W* Info)
{
	struct cmp
	{
		static bool compare(PROCESSENTRY32W* p, LPARAM lParam)
		{
			LPCWSTR pszName1 = PointToName(p->szExeFile);
			LPCWSTR pszName2 = (LPCWSTR)lParam;
			int iCmp = lstrcmpi(pszName1, pszName2);
			return (iCmp == 0);
		};
	};
	LPCWSTR pszName = PointToName(asExeName);
	if (!pszName || !*pszName)
		return false;
	return GetProcessInfo(cmp::compare, (LPARAM)pszName, Info);
}
开发者ID:albert2lyu,项目名称:ConEmu,代码行数:17,代码来源:WObjects.cpp


示例16: GetAnotherPanel

void FilePanels::GoToFile(const wchar_t *FileName)
{
	if (FirstSlash(FileName))
	{
		string ADir,PDir;
		Panel *PassivePanel = GetAnotherPanel(ActivePanel);
		int PassiveMode = PassivePanel->GetMode();

		if (PassiveMode == NORMAL_PANEL)
		{
			PassivePanel->GetCurDir(PDir);
			AddEndSlash(PDir);
		}

		int ActiveMode = ActivePanel->GetMode();

		if (ActiveMode==NORMAL_PANEL)
		{
			ActivePanel->GetCurDir(ADir);
			AddEndSlash(ADir);
		}

		string strNameFile = PointToName(FileName);
		string strNameDir = FileName;
		CutToSlash(strNameDir);
		/* $ 10.04.2001 IS
		     Не делаем SetCurDir, если нужный путь уже есть на открытых
		     панелях, тем самым добиваемся того, что выделение с элементов
		     панелей не сбрасывается.
		*/
		BOOL AExist=(ActiveMode==NORMAL_PANEL) && !StrCmpI(ADir,strNameDir);
		BOOL PExist=(PassiveMode==NORMAL_PANEL) && !StrCmpI(PDir,strNameDir);

		// если нужный путь есть на пассивной панели
		if (!AExist && PExist)
			ProcessKey(KEY_TAB);

		if (!AExist && !PExist)
			ActivePanel->SetCurDir(strNameDir,TRUE);

		ActivePanel->GoToFile(strNameFile);
		// всегда обновим заголовок панели, чтобы дать обратную связь, что
		// Ctrl-F10 обработан
		ActivePanel->SetTitle();
	}
}
开发者ID:alexlav,项目名称:conemu,代码行数:46,代码来源:filepanels.cpp


示例17: wcsncpyz

// For masks like dir1\dir2*\*.ext in non-recursive mode.
bool ScanTree::ExpandFolderMask()
{
  bool WildcardFound=false;
  uint SlashPos=0;
  for (int I=0;CurMask[I]!=0;I++)
  {
    if (CurMask[I]=='?' || CurMask[I]=='*')
      WildcardFound=true;
    if (WildcardFound && IsPathDiv(CurMask[I]))
    {
      // First path separator position after folder wildcard mask.
      // In case of dir1\dir2*\dir3\name.ext mask it may point not to file
      // name, so we cannot use PointToName() here.
      SlashPos=I; 
      break;
    }
  }

  wchar Mask[NM];
  wcsncpyz(Mask,CurMask,ASIZE(Mask));
  Mask[SlashPos]=0;

  // Prepare the list of all folders matching the wildcard mask.
  ExpandedFolderList.Reset();
  FindFile Find;
  Find.SetMask(Mask);
  FindData FD;
  while (Find.Next(&FD))
    if (FD.IsDir)
    {
      wcsncatz(FD.Name,CurMask+SlashPos,ASIZE(FD.Name));

      // Treat dir*\* or dir*\*.* as dir, so empty 'dir' is also matched
      // by such mask. Skipping empty dir with dir*\*.* confused some users.
      wchar *LastMask=PointToName(FD.Name);
      if (wcscmp(LastMask,L"*")==0 || wcscmp(LastMask,L"*.*")==0)
        RemoveNameFromPath(FD.Name);

      ExpandedFolderList.AddString(FD.Name);
    }
  if (ExpandedFolderList.ItemsCount()==0)
    return false;
  // Return the first matching folder name now.
  ExpandedFolderList.GetString(CurMask,ASIZE(CurMask));
  return true;
}
开发者ID:abbeycode,项目名称:UnrarKit,代码行数:47,代码来源:scantree.cpp


示例18: ScanError

void ScanTree::ScanError(bool &Error)
{
#ifdef _WIN_ALL
  if (Error)
  {
    // Get attributes of parent folder and do not display an error
    // if it is reparse point. We cannot scan contents of standard
    // Windows reparse points like "C:\Documents and Settings"
    // and we do not want to issue numerous useless errors for them.
    // We cannot just check FD->FileAttr here, it can be undefined
    // if we process "folder\*" mask or if we process "folder" mask,
    // but "folder" is inaccessible.
    wchar *Slash=PointToName(CurMask);
    if (Slash>CurMask)
    {
      *(Slash-1)=0;
      DWORD Attr=GetFileAttributes(CurMask);
      *(Slash-1)=CPATHDIVIDER;
      if (Attr!=0xffffffff && (Attr & FILE_ATTRIBUTE_REPARSE_POINT)!=0)
        Error=false;
    }

    // Do not display an error if we cannot scan contents of
    // "System Volume Information" folder. Normally it is not accessible.
    if (wcsstr(CurMask,L"System Volume Information\\")!=NULL)
      Error=false;
  }
#endif

  if (Error && Cmd!=NULL && Cmd->ExclCheck(CurMask,false,true,true))
    Error=false;

  if (Error)
  {
    if (ErrDirList!=NULL)
      ErrDirList->AddString(CurMask);
    if (ErrDirSpecPathLength!=NULL)
      ErrDirSpecPathLength->Push((uint)SpecPathLength);
    wchar FullName[NM];
    // This conversion works for wildcard masks too.
    ConvertNameToFull(CurMask,FullName,ASIZE(FullName));
    uiMsg(UIERROR_DIRSCAN,FullName);
    ErrHandler.SysErrMsg();
  }
}
开发者ID:abbeycode,项目名称:UnrarKit,代码行数:45,代码来源:scantree.cpp


示例19: _ASSERTE

void CSetPgDebug::debugLogCommand(CESERVER_REQ* pInfo, BOOL abInput, DWORD anTick, DWORD anDur, LPCWSTR asPipe, CESERVER_REQ* pResult/*=NULL*/)
{
	CSetPgDebug* pDbgPg = (CSetPgDebug*)gpSetCls->GetPageObj(thi_Debug);
	if (!pDbgPg)
		return;
	if (pDbgPg->GetActivityLoggingType() != glt_Commands)
		return;

	_ASSERTE(abInput==TRUE || pResult!=NULL || (pInfo->hdr.nCmd==CECMD_LANGCHANGE || pInfo->hdr.nCmd==CECMD_GUICHANGED || pInfo->hdr.nCmd==CMD_FARSETCHANGED || pInfo->hdr.nCmd==CECMD_ONACTIVATION));

	LogCommandsData* pData = (LogCommandsData*)calloc(1,sizeof(LogCommandsData));

	if (!pData)
		return;

	pData->bInput = abInput;
	pData->bMainThread = (abInput == FALSE) && isMainThread();
	pData->nTick = anTick - pDbgPg->mn_ActivityCmdStartTick;
	pData->nDur = anDur;
	pData->nCmd = pInfo->hdr.nCmd;
	pData->nSize = pInfo->hdr.cbSize;
	pData->nPID = abInput ? pInfo->hdr.nSrcPID : pResult ? pResult->hdr.nSrcPID : 0;
	LPCWSTR pszName = asPipe ? PointToName(asPipe) : NULL;
	lstrcpyn(pData->szPipe, pszName ? pszName : L"", countof(pData->szPipe));
	switch (pInfo->hdr.nCmd)
	{
	case CECMD_POSTCONMSG:
		_wsprintf(pData->szExtra, SKIPLEN(countof(pData->szExtra))
			L"HWND=x%08X, Msg=%u, wParam=" WIN3264TEST(L"x%08X",L"x%08X%08X") L", lParam=" WIN3264TEST(L"x%08X",L"x%08X%08X") L": ",
			pInfo->Msg.hWnd, pInfo->Msg.nMsg, WIN3264WSPRINT(pInfo->Msg.wParam), WIN3264WSPRINT(pInfo->Msg.lParam));
		GetClassName(pInfo->Msg.hWnd, pData->szExtra+lstrlen(pData->szExtra), countof(pData->szExtra)-lstrlen(pData->szExtra));
		break;
	case CECMD_NEWCMD:
		lstrcpyn(pData->szExtra, pInfo->NewCmd.GetCommand(), countof(pData->szExtra));
		break;
	case CECMD_GUIMACRO:
		lstrcpyn(pData->szExtra, pInfo->GuiMacro.sMacro, countof(pData->szExtra));
		break;
	case CMD_POSTMACRO:
		lstrcpyn(pData->szExtra, (LPCWSTR)pInfo->wData, countof(pData->szExtra));
		break;
	}

	PostMessage(pDbgPg->Dlg(), DBGMSG_LOG_ID, DBGMSG_LOG_CMD_MAGIC, (LPARAM)pData);
}
开发者ID:ForNeVeR,项目名称:ConEmu,代码行数:45,代码来源:SetPgDebug.cpp


示例20: GetPassword

bool GetPassword(PASSWORD_TYPE Type,const char *FileName,char *Password,int MaxLength)
{
  Alarm();
  while (true)
  {
    char PromptStr[256];
#if defined(_EMX) || defined(_BEOS)
    strcpy(PromptStr,St(MAskPswEcho));
#else
    strcpy(PromptStr,St(MAskPsw));
#endif
    if (Type!=PASSWORD_GLOBAL)
    {
      strcat(PromptStr,St(MFor));
      strcat(PromptStr,PointToName(FileName));
    }
    eprintf("\n%s: ",PromptStr);
    GetPasswordText(Password,MaxLength);
    if (*Password==0 && Type==PASSWORD_GLOBAL)
      return(false);
    if (Type==PASSWORD_GLOBAL)
    {
      strcpy(PromptStr,St(MReAskPsw));
      eprintf(PromptStr);
      char CmpStr[256];
      GetPasswordText(CmpStr,sizeof(CmpStr));
      if (*CmpStr==0 || strcmp(Password,CmpStr)!=0)
      {
        strcpy(PromptStr,St(MNotMatchPsw));
/*
#ifdef _WIN_32
        CharToOem(PromptStr,PromptStr);
#endif
*/
        eprintf(PromptStr);
        memset(Password,0,MaxLength);
        memset(CmpStr,0,sizeof(CmpStr));
        continue;
      }
      memset(CmpStr,0,sizeof(CmpStr));
    }
    break;
  }
  return(true);
}
开发者ID:cahocachi,项目名称:DEFCON,代码行数:45,代码来源:consio.cpp



注:本文中的PointToName函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PointerIsValid函数代码示例发布时间:2022-05-30
下一篇:
C++ PointAt函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap