Verifique se o Windows Explorer já abriu no caminho especificado
Como posso ver se o Windows Explorer já está aberto com determinado caminho? Não quero que meu aplicativo abra muitas janelas duplicadas. Não consegui fazê-lo desta maneira:
var
H: hwnd;
begin
if FileExists(edt8.Text) then
begin
H := FindWindow(0, PChar(ExtractFilePath(edt8.Text)));
if H <> 0 then
ShowMessage('explorer already opened')//explorer bring to front
else
ShellExecute(Application.Handle, nil, 'explorer.exe',
PChar(ExtractFilePath(edt8.Text)), nil, SW_NORMAL);
end;
end;