Links to original posts
Http://outofmemory.cn/code-snippet/9194/achieve-search-recover-office-information-yiji-qingkong-recover-office
#include <stdio.h>#include<windows.h>#include<shellapi.h>//header files required by Shemptyrecyclebin and ShqueryrecyclebinintMainintargcChar*argv[]) { //initializing the SHQUERYRBINFO structureShqueryrbinfo recyclebininformation; ZeroMemory (&recyclebininformation,sizeof(recyclebininformation)); Recyclebininformation.cbsize=sizeof(recyclebininformation);
//Query Recycle Bin information if(Shqueryrecyclebin (null,&recyclebininformation) = =S_OK)//Shqueryrecyclebin The first parameter is the drive letter or folder to query the Recycle Bin, subfolders//It's the same as the Recycle Bin where the root directory is the same point.//null refers to all recycle bins, and the following Shemptyrecyclebin second parameter is the same{printf ("Recycle Bin all file size%ld\\n", recyclebininformation.i64size); printf ("Recycle Bin number of all files%ld\\n", Recyclebininformation.i64numitems); } Elseprintf ("Shqueryrecyclebin Fail"); //emptying the Recycle bin if(Shemptyrecyclebin (null,null,sherb_noconfirmation| sherb_noprogressui| Sherb_nosound) = =S_OK)//Shemptyrecyclebin Third parameter if you want to display the Confirm Delete dialog box and the sound of things such as emptyprintf"Shemptyrecyclebin Success"); Elseprintf ("Shemptyrecyclebin Fail"); return 0;}//The fragment comes from http://outofmemory.cn
"Go" to query the Recycle Bin information and empty the Recycle Bin