![]() |
Re: URLs aus Firefox-Instanzen auslesen
Na toll, jetzt kommt wieder:
[DCC Fehler] E2033 Die Typen der tatsächlichen und formalen Var-Parameter müssen übereinstimmen Also, mein "kompletter" Code (Mal alles so wie du gemacht - Nur Test!)
Delphi-Quellcode:
unit Unit1;
interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ddeman; type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); private { Private-Deklarationen } public { Public-Deklarationen } end; var Form1: TForm1; implementation procedure GetCurrentURL(out URL, Title: AnsiString); var DDEClient : TDDEClientConv; p, q: PAnsiChar; i: Integer; begin DDEClient := TDDEClientConv.Create(nil); try with DDEClient do if SetLink('IExplore', 'WWW_GetWindowInfo') or SetLink('Netscape', 'WWW_GetWindowInfo') or SetLink('Mosaic', 'WWW_GetWindowInfo') or SetLink('Netscp6', 'WWW_GetWindowInfo') or SetLink('Mozilla', 'WWW_GetWindowInfo') or SetLink('Firefox', 'WWW_GetWindowInfo') then p := RequestData('0xFFFFFFFF') else raise Exception.Create('Could not establish browser DDE link'); if Assigned(p) then try q := p; Assert(q^ = '"'); SetLength(URL, StrLen(q)); Inc(q); i := 0; while q^ <> '"' do begin if (q^ = '\') and (q[1] = '"') then Inc(q); Inc(i); URL[i] := q^; Inc(q); end; SetLength(URL, i); SetLength(Title, StrLen(q)); i := 0; Inc(q, 3); while q^ <> '"' do begin if (q^ = '\') and (q[1] = '"') then Inc(q); Inc(i); Title[i] := q^; Inc(q); end; SetLength(Title, i); finally StrDispose(p); end else raise Exception.Create('Could not fetch browser data'); finally DDEClient.Free; end; end; {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); var url, title: String; begin HIER KOMMT DER FEHLER--> GetCurrentURL(url, title); ShowMessage(url + #13#10 + title); end; end. |
Re: URLs aus Firefox-Instanzen auslesen
Zitat:
Zitat:
Der Parameter der Prozedur ist nun einmal ein AnsiString jetzt, und als var-Parameter muss dieser Typ exakt übereinstimmen. |
Re: URLs aus Firefox-Instanzen auslesen
Was man alles übersehen kann =)
Danke @ jaenicke Also, richtig muss da natürlich sein: AnsiString! |
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:28 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz