![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#8
|
|||
|
|||
|
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! |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
|