I am looking for a way to return a url as a string from the current Internet Explorer URL.
This approach uses dde. It very fast and works well except it returns a very long string in two parts both with quotes.
uses
ddeman;
function GetURL(Service: string): string;
var
ClDDE: TDDEClientConv;
temp: PAnsiChar;
begin
Result := '';
ClDDE := TDDEClientConv.Create(nil);
with ClDDE do
begin
SetLink(Service, 'WWW_GetWindowInfo');
temp := RequestData('0xFFFFFFFF');
Result := StrPas(temp);
StrDispose(temp);
CloseLink;
end;
ClDDE.Free;
end;
For example this returns: "http://core2.staticworld.net/images/article/2014/01/counterfeit_android_apps1-100227383-medium.jpg","http://core2.staticworld.net/images/article/2014/01/counterfeit_android_apps1-100227383-medium.jpg"
But I am looking for just the first part before the first comma without the quotes: http://core2.staticworld.net/images/article/2014/01/counterfeit_android_apps1-100227383-medium.jpg
Any suggestions for another approach or how to parse the string to produce the result shown without quotes and just the first part of the string?