"Go" to query the Recycle Bin information and empty the Recycle Bin

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.