Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > API de Windows
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #4  
Antiguo 23-10-2006
Avatar de seoane
[seoane] seoane is offline
Miembro Premium
 
Registrado: feb 2004
Ubicación: A Coruña, España
Posts: 3.717
Poder: 26
seoane Va por buen camino
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
    // Si la ventana es visible la ocultamos y viceversa
    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;

// Para llamar la funcion
EnumWindows(@EnumWindowsProc, LPARAM(PChar('IMClass')));
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Error Creating cursor handle jose_205711 Conexión con bases de datos 3 06-11-2010 10:04:02
Como deshabilitar el boton inicio??? seba_cipo Seguridad 5 19-04-2006 17:15:35
Deshabilitar boton de la barra de título abracadabra OOP 2 21-12-2005 23:51:46
Deshabilitar barra de direcciones y del menu de una pagina!! arieliten HTML, Javascript y otros 3 05-09-2005 14:47:37
Obtener Handle de un objeto senpiterno Varios 6 22-04-2004 15:21:40


La franja horaria es GMT +2. Ahora son las 19:25:58.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi