コード例 #1
0
ファイル: HlfViewer.cpp プロジェクト: CyberShadow/FAR
intptr_t WINAPI ProcessEditorInputW(const ProcessEditorInputInfo *InputInfo)
{
	LPWSTR FileName=NULL;
	BOOL Result=FALSE;

	if (Opt.ProcessEditorInput)
	{
		if (InputInfo->Rec.EventType==KEY_EVENT && InputInfo->Rec.Event.KeyEvent.bKeyDown && inputrecord_compare(InputInfo->Rec,Opt.RecKey))
		{
			Info.EditorControl(-1,ECTL_GETINFO,0,&ei);
			size_t FileNameSize=Info.EditorControl(-1,ECTL_GETFILENAME,0,0);

			if (FileNameSize)
			{
				FileName=new wchar_t[FileNameSize];

				if (FileName)
				{
					Info.EditorControl(-1,ECTL_GETFILENAME,FileNameSize,FileName);
				}
			}

			if (CheckExtension(FileName))
			{
				ShowCurrentHelpTopic();
				Result=TRUE;
			}
		}
	}

	if (FileName)
	{
		delete[] FileName;
	}

	return Result;
}
コード例 #2
0
ファイル: HlfViewer.cpp プロジェクト: Frankie-666/farmanager
intptr_t WINAPI ProcessEditorInputW(const ProcessEditorInputInfo *InputInfo)
{
	BOOL Result=FALSE;

	if (Opt.ProcessEditorInput)
	{
		if (InputInfo->Rec.EventType==KEY_EVENT && InputInfo->Rec.Event.KeyEvent.bKeyDown && inputrecord_compare(InputInfo->Rec,Opt.RecKey))
		{
			Info.EditorControl(-1,ECTL_GETINFO,0,&ei);
			wchar_t *FileName=GetEditorFileName();

			if (IsHlf() || (Opt.CheckMaskFile && CheckExtension(FileName)))
			{
				if (ShowCurrentHelpTopic())
					Result=TRUE;
			}

			if (FileName)
				delete[] FileName;
		}
	}

	return Result;
}