Thread View: borland.public.cppbuilder.nativeapi
9 messages
9 total messages
Started by Danzer
Tue, 12 Dec 2006 16:04
Internet Options -> Delete Files...
Author: Danzer
Date: Tue, 12 Dec 2006 16:04
Date: Tue, 12 Dec 2006 16:04
5 lines
1064 bytes
1064 bytes
Is there a way to programmatically delete all offline content for internet explorer? I have googled for some type of api call, but have found nothing. Danzer
Re: Internet Options -> Delete Files...
Author: Jonathan Benedicto
Date: Tue, 12 Dec 2006 18:06
Date: Tue, 12 Dec 2006 18:06
56 lines
2532 bytes
2532 bytes
Danzer wrote:
> Is there a way to programmatically delete all offline content for internet
> explorer? I have googled for some type of api call, but have found
> nothing.
How programmatically? :-) Would this do:
// Completely Untested
void ProcessFolder( AnsiString Folder, TStringList *FileList )
{
HANDLE FindHandle;
WIN32_FIND_DATA FindData;
AnsiString SearchPattern;
SearchPattern = AnsiString( Folder ) + "\\*.*";
FindHandle = FindFirstFile( SearchPattern.c_str(), &FindData );
if( FindHandle != INVALID_HANDLE_VALUE )
{
// I *think* that the first item will always be ".", so I *think* it
can be ignored.
while( FindNextFile( FindHandle, &FindData ) )
{
AnsiString FileName = FindData.cFileName;
if( ( FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) ==
FILE_ATTRIBUTE_DIRECTORY )
ProcessFolder( Folder + "\\" + FileName, FileList );
else if( FileName.SubString( 1, 7 ) != "cookie:" )
FileList->Add( Folder + "\\" + FileName );
}
FindClose( FindHandle );
}
}
int i, l;
char Folder[ MAX_PATH + 1 ] = { 0 };
TStringList *FileList = new TStringList();
SHGetFolderPath( NULL, CSIDL_INTERNET_CACHE, NULL, SHGFP_TYPE_CURRENT,
Folder );
ProcessFolder( Folder, FileList );
l = FileList->Count;
for( i = 0; i < l; ++i )
DeleteFile( FileList->Strings[ i ] );
delete FileList;
HTH
Jonathan
Re: Internet Options -> Delete Files...
Author: Minas
Date: Tue, 12 Dec 2006 18:58
Date: Tue, 12 Dec 2006 18:58
37 lines
1924 bytes
1924 bytes
� "Jonathan Benedicto" <invalid@nobody.com> wrote
in msg news:457eef64$1@newsgroups.borland.com...
> void ProcessFolder( AnsiString Folder, TStringList *FileList )
> {
> HANDLE FindHandle;
> WIN32_FIND_DATA FindData;
> AnsiString SearchPattern;
>
> SearchPattern = AnsiString( Folder ) + "\\*.*";
>
> FindHandle = FindFirstFile( SearchPattern.c_str(), &FindData );
> if( FindHandle != INVALID_HANDLE_VALUE )
> {
> // I *think* that the first item will always be ".", so I *think*
> it can be ignored.
// The second Item will be ".." so to avoid also that just add
//before while loop
FindNextFile( FindHandle, &FindData ) ;
> while( FindNextFile( FindHandle, &FindData ) )
> {
> AnsiString FileName = FindData.cFileName;
>
> if( ( FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) ==
> FILE_ATTRIBUTE_DIRECTORY )
_minas
------
"Only the virtue's conquests have certainty" Sofokleous Erephyle
Re: Internet Options -> Delete Files...
Author: Danzer
Date: Tue, 12 Dec 2006 19:10
Date: Tue, 12 Dec 2006 19:10
11 lines
1372 bytes
1372 bytes
Jonathan Benedicto wrote: > Danzer wrote: >> Is there a way to programmatically delete all offline content for internet >> explorer? I have googled for some type of api call, but have found >> nothing. > > How programmatically? :-) Would this do: > I was hoping for a DeleteIETempFiles() function that I had missed in the api. :-)
Re: Internet Options -> Delete Files...
Author: Ed Mulroy
Date: Tue, 12 Dec 2006 19:16
Date: Tue, 12 Dec 2006 19:16
15 lines
1383 bytes
1383 bytes
Source, executable and make file for a program which does that are in this zip file: http://www.mulroy.org/deltemp.zip Note that it was written quickly for my own purposes so is not an example of code about which one could brag. :-) . Ed > Danzer news:457ed32b$1@newsgroups.borland.com... > > Is there a way to programmatically delete all offline content for internet > explorer? I have googled for some type of api call, but have found > nothing.
Re: Internet Options -> Delete Files...
Author: Danzer
Date: Tue, 12 Dec 2006 21:48
Date: Tue, 12 Dec 2006 21:48
16 lines
1343 bytes
1343 bytes
Ed Mulroy wrote: > Source, executable and make file for a program which does that are in this > zip file: > > http://www.mulroy.org/deltemp.zip > > Note that it was written quickly for my own purposes so is not an example of > code about which one could brag. :-) > > . Ed Beggars can't be choosers. I did not see any goto's: looks fine to me. :-) Danzer
Re: Internet Options -> Delete Files...
Author: Remy Lebeau (TeamB)
Date: Tue, 12 Dec 2006 22:32
Date: Tue, 12 Dec 2006 22:32
13 lines
1319 bytes
1319 bytes
"Danzer" <.> wrote in message news:457ed32b$1@newsgroups.borland.com... > Is there a way to programmatically delete all offline content for > internet explorer? I have googled for some type of api call, but have > found nothing. Have a look at FindFirstUrlCacheGroup(), FindNextUrlCacheGroup(), and DeleteUrlCacheGroup(). Alternatively, look at FindFirstUrlCacheEntry/Ex(), FindNextUrlCacheEntry/Ex() and DeleteUrlCacheEntry(). Gambit
Re: Internet Options -> Delete Files...
Author: Ed Mulroy
Date: Tue, 12 Dec 2006 22:48
Date: Tue, 12 Dec 2006 22:48
17 lines
1449 bytes
1449 bytes
>...I did not see any goto's... I have more subtle ways of cutting abomidable code when writing a 'quicky' <g> Now you have the list of cookies that I keep so that I don't have to re-login. Personal information, oh my <g> I hope it helps. . Ed > Danzer wrote in message > news:457f23c1$1@newsgroups.borland.com... > > Beggars can't be choosers. I did not see any goto's: looks fine to me. > :-)
Re: Internet Options -> Delete Files...
Author: Danzer
Date: Wed, 13 Dec 2006 19:12
Date: Wed, 13 Dec 2006 19:12
13 lines
1385 bytes
1385 bytes
> Have a look at FindFirstUrlCacheGroup(), FindNextUrlCacheGroup(), and > DeleteUrlCacheGroup(). Alternatively, look at FindFirstUrlCacheEntry/Ex(), > FindNextUrlCacheEntry/Ex() and DeleteUrlCacheEntry(). > Googling those functions I found this. http://www.codeguru.com/Cpp/I-N/ieprogram/article.php/c1245/ Functioning code already written! Danzer
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads