Club Delphi  
    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

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 24-06-2005
jorodgar jorodgar is offline
Miembro
 
Registrado: abr 2005
Posts: 76
Poder: 20
jorodgar Va por buen camino
Obtener URL en mozilla/firefox

¿ Existe forma de saber que páginas esta visitando un usuario que tiene mozilla/firefox?
Con IE si lo encontre pero con otros navegadores no he tenido suerte.
¿ Alguna idea ? Gracias.
Responder Con Cita
  #2  
Antiguo 25-06-2005
jorodgar jorodgar is offline
Miembro
 
Registrado: abr 2005
Posts: 76
Poder: 20
jorodgar Va por buen camino
De momento solo he obtenido el titulo haciendo lo siguiente.
Me he guiado con el programa WinSPy 1.0 para obtener las classes.
Como obtengo la URL???

Código Delphi [-]
 unit Unit1;
 
 interface
 
 uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, StdCtrls;
 
 type
   TForm1 = class(TForm)
   Button1: TButton;
   lbIEURL: TListBox;
   procedure Button1Click(Sender: TObject);
   private
     { Private declarations }
   public
     { Public declarations }
   end;
 
 var
   Form1: TForm1;
 
 function GetUrlFromFirefox (Handle: THandle; List: TStringList): boolean; stdcall;
 
 implementation
 
 {$R *.dfm}
 
 function GetUrlFromFirefox (Handle: THandle; List: TStringList): boolean; stdcall;
 var
   hWndFX, hWndFXChild : HWND;
   Buffer : array[0..255] of Char;
 begin
   SendMessage(Handle, WM_GETTEXT, 255, integer(@Buffer[0]));
 
   hWndFX := FindWindow('MozillaWindowClass', Buffer);
   if hWndFX > 0 then
   begin
     SendMessage(hWndFXChild, WM_GETTEXT, 255, integer(@Buffer));
     if buffer<>'' then
       List.AddObject(Buffer,TObject(hWndFX));
   end;
   Result :=True;
 end;
 
 procedure TForm1.Button1Click(Sender: TObject);
 begin
   lbIEURL.Clear;
   EnumWindows(@GetUrlFromFirefox, LParam(lbIEURL.Items));
 end;
 
 end.

Última edición por dec fecha: 10-09-2005 a las 07:00:16. Razón: Encerrar el código fuente en la etiqueta [DELPHI]
Responder Con Cita
  #3  
Antiguo 26-06-2005
jorodgar jorodgar is offline
Miembro
 
Registrado: abr 2005
Posts: 76
Poder: 20
jorodgar Va por buen camino
Solucion

A continuación el código fuente:

Código Delphi [-]
unit Unit1;
 
 interface
 
 uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, DDEman, StdCtrls;
 
 type
   TForm1 = class(TForm)
   Button1: TButton;
   Edit1: TEdit;
   Edit2: TEdit;
   procedure Button1Click(Sender: TObject);
   private
     { Private declarations }
   public
     { Public declarations }
   procedure GetCurrentURL (var URL, Title : string);
 end;
 
 var
   Form1: TForm1;
 
 implementation
 
 {$R *.dfm}
 
 procedure TForm1.GetCurrentURL (var URL, Title : string);
 var
   DDEClient : TDDEClientConv;
   s : string;
 begin
   s := '';
   try
     DDEClient := TDDEClientConv.Create(self);
     with DDEClient do
     begin
       if SetLink('IExplore','WWW_GetWindowInfo') then
         s := RequestData('0xFFFFFFFF,sURL,sTitle')
       else
       if SetLink('Netscape','WWW_GetWindowInfo') then
         s := RequestData('0xFFFFFFFF,sURL,sTitle')
       else
       if SetLink('Mosaic','WWW_GetWindowInfo') then
         s := RequestData('0xFFFFFFFF,sURL,sTitle')
       else
       if SetLink('Netscp6','WWW_GetWindowInfo') then
         s := RequestData('0xFFFFFFFF,sURL,sTitle')
       else
       if SetLink('Mozilla','WWW_GetWindowInfo') then
         s := RequestData('0xFFFFFFFF,sURL,sTitle')
       else
       if SetLink('Firefox','WWW_GetWindowInfo') then
         s := RequestData('0xFFFFFFFF,sURL,sTitle');
     end;
     if s <> '' then
     begin
       delete(s,1,1);
       URL := copy(s,1,pos('","',s)-1);
       delete(s,1,pos('","',s)+2);
       Title := copy(s,1,pos('"',s) - 1);
     end;
     exit;
   except
     MessageDlg('URL attempt failed!',mtError,[mbOK],0);
   end;
 end;
 
 procedure TForm1.Button1Click(Sender: TObject);
 var
   URL : string;
   Title : string;
 begin
   GetCurrentURL (URL, Title);
   Edit1.Text := URL;
   Edit2.Text := Title;
 end;
 
 end.

Última edición por dec fecha: 10-09-2005 a las 07:05:55. Razón: Encerrar el código fuente en la etiqueta [DELPHI]
Responder Con Cita
Respuesta



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 06:22:38.


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