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 Buscar Temas de Hoy Marcar Foros Como Leídos

 
 
Herramientas Buscar en Tema Desplegado
  #8  
Antiguo 02-01-2004
chavetaz chavetaz is offline
Miembro
 
Registrado: oct 2003
Ubicación: Buenos Aires, Argentina
Posts: 29
Poder: 0
chavetaz Va por buen camino
Lightbulb

Ya lo tengo solucionado, las primeras pruebas parecen favorables, ejecuto el siguiente codigo y me devuelve el path de la ventana del windows explorer que tuvo el foco por ultima vez, o sea de cuatro ventanas de windows explorer abiertas me duvuelve la que estuvo mas al frente recientemente, seguramente se pueda optimizar el codigo pero basicamente es este:

function TForm1.GetPath: String;
var
win, toolbar, comboboxex, worker:hwnd;
begin
win := FindWindow(pchar('CabinetWClass'),nil);
worker := FindWindowEx(win,0,'WorkerW',nil);
toolbar := FindWindowEx(worker,0,'rebarwindow32',nil);
comboboxex := FindWindowEx(toolbar, 0, 'comboboxex32', nil);
result := GetText(comboboxex);
end;

function TForm1.GetText(WindowHandle: hwnd): string;
var
txtLength : integer;
buffer: string;
begin
TxtLength := SendMessage(WindowHandle, WM_GETTEXTLENGTH, 0, 0);
txtlength := txtlength + 1;
setlength (buffer, txtlength);
sendmessage (WindowHandle,wm_gettext, txtlength, longint(@buffer[1]));
result := buffer;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage(GetPath);
end;

muchas gracias a todos por su ayuda!
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

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


La franja horaria es GMT +2. Ahora son las 01:37:35.


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