-
July 18th, 2003, 09:34 AM
#1
Junior Member
internet washer question
Hi Guys,
I am designing a history cleaner using VC++.
I use registry functions to clear it.
Problem 1: I clear document history by locating at HCU/software/ms/windows/current version/explorer/recdocs...
But in start /documents-> i see the files even after deleting from registry.
when I restart the machine , it clears. But I want it working without restarting the machine.
HOw is it posiible?
Problem 2: Deleting from recycle bin, doesnt actually deletes the file.
It only removes the association.
how to delete it, what function should I use for it?
ANy location in Registry can do this?
I read about shred files . HOw can it help in this..can anyone help me out in deleting the files
-
July 18th, 2003, 11:39 PM
#2
There is a nice function that will clear the documents history from the start menu.
SHAddToRecentDocs();
Here is an example I copyed from http://www.winprog.org/faq/#3.4.3. Thanks to Winprog for that.
/***********************************************
ClearMRU
Action: Clears all items on the Windows MRU list
***********************************************/
void ClearMRU()
{
SHAddToRecentDocs(SHARD_PATH,NULL);
}
To empty the recycle bin, there is a function SHEmptyRecycleBin() Now this I am not sure if is included In VC++ however if its not you can always load it from Shell32.dll
The function exists inside C:\Windows\System\Shell32.dll
It is a dynamic link library and contains an export list of functions, Inside is the function SHEmptyRecycleBinW and SHEmptyRecycleBinA, they are both the same but one is unicode and the other is ASCII. You can use the functions LoadLibrary() in VC++ to load shell32 into memory. then you can use GetProcAddress to retrieve a pointer to the function in memory. I can give you an example of how to do this in VC++ if you want.
EDIT: Ok did some research for you, SHEmptyRecycleBin will work, you need to #include "stdafx.h" atop your source code. Along with the windows.h headder of cource. Heres and example:
SHEmptyRecycleBin(NULL,NULL,SHERB_NOPROGRESSUI);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|