![]() |
| | #1 | |
| Registered User Join Date: Jan 2008
Posts: 42
| under Vista, i used to delete my Thumbnail Cache files : Quote:
Code: if ( !DeleteFile( filesC.Item( i ) ) )
{
DWORD dwAttC = GetFileAttributes( filesC.Item( i ) );
dwAttC &= ~( FILE_ATTRIBUTE_READONLY );
SetFileAttributes( filesC.Item( i ), dwAttC );
DeleteFile( filesC.Item( i ) );
}
Under Windows 7 this is not the case, those files are not deleted or regenerated even after restarting the system. Am i missing something, or there is some way to notify explorer.exe to delete those files? Thanks in advance. | |
| patrick22 is offline | |
| | #2 |
| and the hat of vanishing Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,214
| I'm guessing you need to look at the return result of DeleteFile() and generate some kind of meaningful error message.
__________________ If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut. Up to 8Mb PlusNet broadband from only £5.99 a month! |
| Salem is offline | |
| | #3 |
| Registered User Join Date: Jan 2008
Posts: 42
| Under Vista: -The first call to DeleteFile returns 0, and GetLastError returns ERROR_ACCESS_DENIED. -After changing the file attribute, DeleteFile returns non-zero value(success). -Thumbnails are regenerated automatically after restarting explorer.exe. Under Windows 7: -The first call to DeleteFile returns 0, and GetLastError returns ERROR_ACCESS_DENIED. -After changing the file attribute, DeleteFile returns 0, and GetLastError returns again ERROR_ACCESS_DENIED. -Thumbnails are not deleted or regenerated even after restarting the System. |
| patrick22 is offline | |
| | #4 |
| and the hat of vanishing Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,214
| Well there you go then - you have the answer.
__________________ If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut. Up to 8Mb PlusNet broadband from only £5.99 a month! |
| Salem is offline | |
| | #5 | ||
| Unregistered User Join Date: Jul 2007
Posts: 925
| Quote:
Quote:
As for deleting them, try blanking out the file's security descriptor before deleting and see if it works.
__________________ GCC 4.4.0, Code::Blocks 8.02, Fedora 11, x64 | ||
| Yarin is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Proper Usage of the delete Operator | thetinman | C++ Programming | 7 | 04-25-2007 11:53 PM |
| Dialog Box Problems | Morgul | Windows Programming | 21 | 05-31-2005 05:48 PM |
| dual boot Win XP, win 2000 | Micko | Tech Board | 6 | 05-30-2005 02:55 PM |
| delete and delete [] | Lionel | C++ Programming | 8 | 05-19-2005 01:52 PM |
| FlashWindowEx not declared? | Aidman | Windows Programming | 3 | 05-17-2003 02:58 AM |