From: embark on
Hi there:

How to access the icon of a site that a browser is displaying?
( for example, if we use IE, the icon of the site will displayed on
the
left side of the tab )

and, if we only have the URL and the browser is not displaying the
site,
how do we get the icon of that site ?

Thanks !
From: Jackie on
embark wrote:
> Hi there:
>
> How to access the icon of a site that a browser is displaying?
> ( for example, if we use IE, the icon of the site will displayed on
> the
> left side of the tab )
>
> and, if we only have the URL and the browser is not displaying the
> site,
> how do we get the icon of that site ?
>
> Thanks !

Hello,

http://lmgtfy.com/?q=html+icon

Please try the very first result. :)

--
Regards,
Jackie
From: embark on
On 7月20日, 上午1時41分, Jackie <Jac...(a)an.on> wrote:
> embark wrote:
> > Hi there:
>
> > How to access the icon of a site that a browser is displaying?
> > ( for example, if we use IE, the icon of the site will displayed on
> > the
> >   left side of the tab )
>
> > and, if we only have the URL and the browser is not displaying the
> > site,
> > how do we get the icon of that site ?
>
> > Thanks !
>
> Hello,
>
> http://lmgtfy.com/?q=html+icon
>
> Please try the very first result. :)
>
> --
> Regards,
> Jackie


Well, a very good tutorial site,

so, only we fetch the favicon.ico ?
but,I am not familiar with internet code,
is there any simple API or function to fetch a file on net?
( I use VS 2008 C++ )

Thanks Again !
From: Richard Russell on
On Jul 19, 8:08 pm, embark <retro5...(a)gmail.com> wrote:
> so, only we fetch the favicon.ico ?
> but,I am not familiar with internet code,
> is there any simple API or function to fetch a file on net?

URLDownloadToFile will probably do it:

http://msdn.microsoft.com/en-us/library/ms775123.aspx

Richard.
http://www.rtrussell.co.uk/
From: Jackie on
embark wrote:
> Well, a very good tutorial site,
>
> so, only we fetch the favicon.ico ?
> but,I am not familiar with internet code,
> is there any simple API or function to fetch a file on net?
> ( I use VS 2008 C++ )
>
> Thanks Again !

Yes. Either favicon.ico in the *root* directory or a different path with:
<link REL="SHORTCUT ICON" HREF="...ico">

Seems like URLDownloadToFile (like Richard suggested) can download
files, but it also seems like it is poorly documented. :(

It may be a good idea to have an HTML parser as well if you don't want
to use regular expressions or such to search for where the icon is
located (in the source code).

I found Xerces-C++ XML Parser (http://xerces.apache.org/xerces-c/).
It will work for XML/XHTML but not HTML, so you need to convert it to
XML first (or maybe you can find an HTML parser).

Someone suggested tidyHTML (http://tidy.sourceforge.net/). You would
download the file, run it through tidyHTML and then Xerces.

There's some code for an HTML parser here which uses MSHTML:
http://www.codeguru.com/cpp/i-n/ieprogram/article.php/c4385

I am sure there are others sample codes for downloading files if
URLDownloadToFile isn't good enough for you.

--
Regards,
Jackie