janela aberta ou fechada...
preciso saber se o photoshop esta aberto e se estiver não fazer nada, alguém pode me ajudar ?
já tentei FindWindow e não deu certo...
já tentei FindWindow e não deu certo...
Aps
Curtidas 0
Respostas
Aps
18/01/2014
vou tentar ser mais básico, alguém sabe como ver se um programa esta aberto ou fechado pelo delphi ?
GOSTEI 0
Aps
18/01/2014
consegui ajuda em outro fórum, vlw
cód:
depois só usar if
cód:
function PrgRodando(Executavel: WideString): Boolean; Export; StdCall;
var
ContinueLoop: BOOL;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
begin
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := SizeOf(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
Result := False;
while Integer(ContinueLoop) <> 0 do
begin
if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) =
UpperCase(Executavel)) or (UpperCase(FProcessEntry32.szExeFile) =
UpperCase(Executavel))) then
begin
Result := True;
end;
ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
end;depois só usar if
If PrgRodando('uTorrent.exe') Then
GOSTEI 0