ACustomApp finds the handle of Seer
c++
HWND seer = FindWindowEx(nullptr, nullptr, SEER_CLASS_NAME, nullptr);
ACustomApp prepares the full path of selected file
Sends path to the handle of Seer
c++
void sendPath2Seer(HWND seer, LPCWSTR path)
{
COPYDATASTRUCT cd;
cd.cbData = (_tcslen(path) + 1) * sizeof(TCHAR);
cd.lpData = (LPVOID)path;
cd.dwData = SEER_INVOKE_W32;
SendMessage(seer, WM_COPYDATA, 0, (LPARAM)&cd);
}
Seer displays the preview of the path
ACustomExplorer
process
ACustomExplorer: create a new text file to store your classname
Seer: all json files in this path will be loaded after Seer is started. When the user presses the space, Seer gets the handle to match the classname through GetForegroundWindow. If it matches ACustomExplorer, Seer sends a WM_COPYDATA message to the handle, and the value of dwData is SEER_REQUEST_PATH .
ACustomExplorer: after receives WM_COPYDATA, it matches the SEER_REQUEST_PATH of dwData, and sends a message back as soon as possible with the full path of the selected file.
Seer: when the Seer receives the message, it previews the file and the process ends.
The logic code is all Win32, which has nothing to do with the Qt code of the UI, even if there is no Qt framework, it will not affect the reading.