He encontrado otro script (Chino...) pero es demasiadooo avanzado para mi, no se como utilizarlo
Creo que sirve para buscar el titulo de la ventana de un proceso
Una ayuda???
EDITO:
He conseguido sacar el título de la consola de windows , la CMD:
Pero ni idea de como hacerlo para todos los processos abiertos....
Quisiera algo así:
			Creo que sirve para buscar el titulo de la ventana de un proceso
Una ayuda???
Código (ruby) [Seleccionar] 
require 'Win32API'
class Wnd
#for GetWindow
=begin
GW_CHILD=
GW_OWNER=
GW_HWNDFIRST=
GW_HWNDNEXT=
#for GetNextWindow
GW_HWNDNEXT=
GW_HWNDPREV=
=end
def initialize
    @hw = nil
    @GetWindow = Win32API.new("user32","GetWindow",['L']*2,'L')
    #top child
    @GetTopWindow = Win32API.new("user32","GetTopWindow",['L'],'L')
    # @GetNextWindow = Win32API.new("user32","GetNextWindowA",['L']*2,'L')
    @GetActiveWindow = Win32API.new("user32","GetActiveWindow",[],'L')
    @GetDesktopWindow = Win32API.new("user32","GetDesktopWindow",[],'L')
@FindWindow=Win32API.new("user32","FindWindowA",['L','P'],'L')
    @SetForegroundWindow=Win32API.new("user32","SetForegroundWindow",['L'],'V')
    @GetWindowText = Win32API.new("user32","GetWindowText",['L','P','i'],'i')
   
end
def find(cap)
    @hw = @FindWindow.Call(0,cap)
end
def fg
    @SetForegroundWindow.Call(@hw)
end
def caption
    lpString="\0"*251
    len = @GetWindowText.Call(@hw,lpString,250)
    p len
    lpString[0,len]
end
def test
   
end
end
wnd1=Wnd.new
wnd1.find("Win32 SDK Reference Help")
wnd1.fg
puts wnd1.caption
__END__EDITO:
He conseguido sacar el título de la consola de windows , la CMD:
Código (ruby) [Seleccionar] 
require 'Win32API'
 
  b = Win32API.new('kernel32' , 'GetConsoleWindow' , [] , 'L').call 
  title = ' '*100
  win = Win32API.new('user32', 'GetWindowText', ['L', 'P', 'I'], 'I').Call(b, title, 256)
puts titlePero ni idea de como hacerlo para todos los processos abiertos....
Quisiera algo así:
Código (ruby) [Seleccionar] 
require 'Win32API'
 
  b = Win32API.new('kernel32' , 'Get ALL WINDOWS' , [] , 'L').call 
  title = ' '*100
 if title.include? "archivo abierto"
   abort
 end
				 
 
 ). Lo cierto es que lo volveré a editar si me doy cuenta de algún fallo...
). Lo cierto es que lo volveré a editar si me doy cuenta de algún fallo...

