Yo sigo contestándote en Delphi, espero que no te moleste

Para encontrar todas las ventanas tenemos dos opciones, utilizar un bucle con la función FindWindowEx o usar la función EnumWindows. Te pongo las dos y decide tu.
Usando FindWindowEx en un bucle:
Código Delphi
[-]
var
Ventana: THandle;
begin
Ventana:= FindWindowEx(0,0,'IMClass',nil);
if Ventana > 0 then
repeat
if isWindowVisible(Ventana) then
ShowWindow(Ventana,SW_HIDE)
else
ShowWindow(Ventana,SW_SHOW);
Ventana:= FindWindowEx(0,Ventana,'IMClass',nil);
until Ventana = 0;
end;
Usando la función EnumWindows:
Código Delphi
[-]
function EnumWindowsProc(Handle: Thandle; lParam: LPARAM): BOOL; stdcall;
var
Buffer: PChar;
Size: Integer;
begin
Result:= TRUE;
if PChar(lParam) <> nil then
begin
Size:= Strlen(PChar(lParam)) + 1;
GetMem(Buffer,Size);
try
FillChar(Buffer^,Size,0);
GetClassName(Handle,Buffer,Size);
if StrIcomp(PChar(lParam), Buffer) = 0 then
if isWindowVisible(Handle) then
ShowWindow(Handle,SW_HIDE)
else
ShowWindow(Handle,SW_SHOW);
finally
Freemem(Buffer);
end;
end;
end;
EnumWindows(@EnumWindowsProc, LPARAM(PChar('IMClass')));