How to get selected file fullpath without dopusrt.exe?

I noticed that dopusrt.exe /info output.txt,listsel,0 is able to get the selected path. However, it is too slow for me when I need to open/close a process and wait for it, then parse a XML file. I realized that Ctrl+C could help me to get what I want, but this operation changes the clipboard, it's way more worse.

I also found that WM_USER+33304 was received when the command line was executed.
So I was wondering if maybe I could get the selected path directly without the dopusrt.exe which would be much more faster and elegant.

Please help~~

PS:
Another way is that it seems possible to get the Folder name from dopus.filedisplaycontainer, so it would nice if I can get the selected file name from dopus.filedisplay.

Running a process and reading a small XML file shouldn't take a noticeable amount of time. Is using that method really that slow?

Yes. The other problem is that I can see the cursor turned to waiting shape every time I run dopusrt.exe.

Sounds like you're using ShellExecute(Ex) which can be slower than CreateProcess. It has a flag to prevent the cursor change, but using CreateProcess would speed things up as well as prevent the cursor change, I think.

(Unless I'm confused. Not at my PC right now to double-check.)

So could I have a direct way to get the path?
Because I wish to access the data quite frequently.

What kind of thing are you doing?

The provided method seems fast enough to me, from a quick test, at least with moderate selection sizes:

That is with full XML parsing as well; it could be sped up by taking shortcuts with the input file.

int main()
{
	LeoHelpers::CoInitScoper cos;
	LeoHelpers::StringInitScoper sic;

	const wchar_t *szListPath = L"C:\\Users\\Leo\\AppData\\Local\\Temp\\OpusSelection.txt";
	std::wstring strArgs = L"/info ";
	strArgs += szListPath;
	strArgs += L",listsel,0";

	while(true)
	{
		DWORD dwStart = ::GetTickCount();

		if (!::DeleteFile(szListPath) && ::GetLastError() != ERROR_FILE_NOT_FOUND)
		{
			wprintf(L"Failed to delete old list file: %d\n", ::GetLastError());
			return -1;
		}

		HANDLE hProcess{};
		if (!LeoHelpers::CreateProcessWrapper(L"C:\\Program Files\\GPSoftware\\Directory Opus\\dopusrt.exe", strArgs.c_str(),
			false, nullptr, true, &hProcess, nullptr, false, SW_HIDE))
		{
			wprintf(L"CreateProcess failed: %d\n", ::GetLastError());
			return -1;
		}
	
		if (!hProcess)
		{
			wprintf(L"CreateProcess didn't return a handle\n");
			return -1;
		}

		::WaitForSingleObject(hProcess, INFINITE);
		::CloseHandle(hProcess);
		hProcess = nullptr;

		DWORD dwLoadStart = ::GetTickCount();

		TiXmlDocument xmlDoc;
		if (!xmlDoc.LoadFile(szListPath))
		{
			wprintf(L"Failed to load list file\n");
			return -1;
		}

		xmlDoc.SetDocumentNameValue(szListPath); // Must call SetDocumentNameValue, not SetValue, for unicode support.

		TiXmlElement *pResultsNode = xmlDoc.FirstChildElement("results");
		if (!pResultsNode)
		{
			wprintf(L"List file has no results node\n");
			return -1;
		}

		TiXmlElement *pItemsNode = pResultsNode->FirstChildElement("items");
		if (!pItemsNode)
		{
			wprintf(L"List file has no items node\n");
			return -1;
		}

		TiXmlElement *pItemNode = pItemsNode->FirstChildElement("item");
		if (!pItemNode)
		{
			wprintf(L"Nothing is selected\n");
		}
		else
		{
			while(pItemNode)
			{
				std::wstring strName = ConvertString( pItemNode->Attribute("name") );
				if (strName.empty())
				{
					wprintf(L"Item with empty or missing name\n");
					return -1;
				}

				wprintf(L"Selected name: %s\n", strName.c_str());

				pItemNode = pItemNode->NextSiblingElement("item");
			}
		}

		DWORD dwEnd = ::GetTickCount();

		wprintf(L"---------------------------------------------------------- %d ms\n", dwEnd-dwStart);
	//	wprintf(L"Total: %d ms, List: %d, Load: %d\n", dwEnd-dwStart, dwLoadStart-dwStart, dwEnd-dwLoadStart);
	}
	
	return 0;
}

If you have a large number of files selected it does get a bit slower, down to about 300-400ms to generate the list file with 5,000 items selected.

If you need it faster than that, please give some detail on what you're trying to do so we can understand why you need it, and please also link your account.