Thread: Erase junk prog

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    36
    Rep Power
    13

    Question Erase junk prog


    HI i was wondering how i could make a prog that when i double clicked it, it would erase all my IE history ect. to cleanup room on my HD. (I am too lazy to go delete history ect ;)) Is there an easy way i could do this? Im not asking anyone to wright it for me, however, i am sure icould understand the code if you did ;) But all i am really asking is some help to get me off on the right foot. Thanks for any help that i can get.

    -Optix :D :D :D
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,638
    Rep Power
    4247
    There are a number of functions you have to play with, depending on what you want. For starters, I would suggest studying the SHxxx group of functions, such as:
    SHEmptyRecycleBin()
    SHDeleteKey()
    SHGetSpecialFolderPath()

    There is a lot of info about this group of functions on MSDN, and reading the documentation ought to be a good starting point.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    36
    Rep Power
    13
    Aight cool! Thanks!
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    36
    Rep Power
    13
    Aight, I tried doing the empty recycle bin thing, but i get a bunch of errors on compilation. here is the code i have.

    Code:
    #include <iostream>
    using namespace std;
    #include <shellapi.h>
    #include <conio.h>
    HRESULT SHEmptyRecycleBin(HWND hwnd,
        LPCTSTR pszRootPath,
        DWORD dwFlags
    );
    
    int main()
    {
    	cout << "Deleting..\n";
    	SHEmptyRecycleBin(NULL,NULL,SHERB_NOPROGRESSUI);
    	cout << "Done";
    	getch();
    	return 0;
    }
    I get errors like,

    c:\program files\microsoft visual studio\vc98\include\shellapi.h(53) : error C2065: 'HDROP' : undeclared identifier
    c:\program files\microsoft visual studio\vc98\include\shellapi.h(53) : error C2501: 'DECLARE_HANDLE' : missing storage-class or type specifiers
    c:\program files\microsoft visual studio\vc98\include\shellapi.h(55) : error C2146: syntax error : missing ';' before identifier 'UINT'
    c:\program files\microsoft visual studio\vc98\include\shellapi.h(55) : error C2501: 'DECLSPEC_IMPORT' : missing storage-class or type specifiers
    c:\program files\microsoft visual studio\vc98\include\shellapi.h(55) : fatal error C1004: unexpected end of file found

    Anyone know why i am getting these errors? I have tried it in VC++ .NET and VC++ 6.0 in 6.0 i get 5 errors and in .NET i get past a 100. (c:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\ShellAPI.h(75): fatal error C1003: error count exceeds 100; stopping compilation
    )

    thanks.
  8. #5
  9. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,638
    Rep Power
    4247
    did you #include "stdafx.h"
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    36
    Rep Power
    13
    Nope, didnt have that :p But still when it compiles, it has the same errors :(
  12. #7
  13. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,638
    Rep Power
    4247
    You probably have to include <windows.h> or something similar then. Just out of curiosity, why don't you use the wizard to create you a skeleton project, so that you have some of the includes, compile options and paths already set up correctly for you. That way, you can avoid a lot of these compile and link errors.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    36
    Rep Power
    13
    Sweet using windows.h fixed it! Thanks for the tip on the skeleton project, i never thought of that lol. Thanks a lot for your help Scorpian.

    -Optix

    edit: lol making something that actually does something is cool! :D

IMN logo majestic logo threadwatch logo seochat tools logo