How to tell if a file or a folder could be placed into the Recycle Bin?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12

Thread: How to tell if a file or a folder could be placed into the Recycle Bin?

  1. #1
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    828

    How to tell if a file or a folder could be placed into the Recycle Bin?

    Say, I have the "K:\test del USB" folder. Then I do the following:

    Code:
    SHFILEOPSTRUCT sfo = {0};
    sfo.wFunc = FO_DELETE;
    sfo.pFrom = L"K:\\test del USB\0";
    sfo.fFlags = FOF_ALLOWUNDO |
         FOF_SILENT | /*FOF_NOCONFIRMATION |*/ FOF_NOERRORUI | FOF_NOCONFIRMMKDIR |
         FOF_WANTNUKEWARNING;
    
    int res = SHFileOperation(&sfo);
    BOOL bFullSuccess = res == 0 && !sfo.fAnyOperationsAborted;
    So when I run it, the SHFileOperation API shows this warning:

    Are you sure you want to permanently delete this folder?
    Name:  1.png
Views: 395
Size:  16.5 KB

    If the end-user clicks "No", SHFileOperation return 0x4c7, which I believe is ERROR_CANCELLED.

    My question is, if I don't need any UI, how can I know that my file/folder will be permanently deleted vs. placed into the Recycle Bin?

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,418

    Re: How to tell if a file or a folder could be placed into the Recycle Bin?

    The way I read the documentation is that if a user clicks "No", the operation is aborted and the file(s) aren't permanently deleted or placed in the recycle bin (you can check the fAnyOperationsAborted flag). If you need to permanently delete the file (as msdn says), you must pass in a full path to the file to be deleted and make sure the FOF_ALLOWUNDO flag isn't set or use DeleteFile.

  3. #3
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    828

    Re: How to tell if a file or a folder could be placed into the Recycle Bin?

    No, I don't want to delete it permanently. Quite opposite, I need to put that folder in the Recycle Bin. My issue is knowing that it will be actually put into the bin as opposed to permanently deleted. As I said above, this actually works when I enable the Explorer's UI. I need it to work without the UI though.

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,418

    Re: How to tell if a file or a folder could be placed into the Recycle Bin?

    So it doesn't work when you specify the full path and the allow undo flag?

  5. #5
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    828

    Re: How to tell if a file or a folder could be placed into the Recycle Bin?

    If I uncomment the FOF_NOCONFIRMATION flag in my code sample above and call it, say, on a very large folder, or a folder located on an external drive that doesn't have a Recycled Bin, it will be permanently deleted. Thus my question in the title. In other words, there's no way of knowing whether something will be placed into the bin or deleted for good.

  6. #6
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,418

    Re: How to tell if a file or a folder could be placed into the Recycle Bin?

    There doesn't seem to be with this api, does there? Can you take a different approach, such as IFileOperation (Vista and above only)?

    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

  7. #7
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,049

    Re: How to tell if a file or a folder could be placed into the Recycle Bin?

    only local files on a fixed disk can be recycled.

    networked (remote) and files on a non-fixed disk (USB sticks) can't be recycled.
    See GetDriveType() on MSDN

  8. #8
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,039

    Re: How to tell if a file or a folder could be placed into the Recycle Bin?

    Quote Originally Posted by dc_2000 View Post
    on a very large folder, or a folder located on an external drive that doesn't have a Recycled Bin, it will be permanently deleted. Thus my question in the title.
    You know, the answer seems to be pretty obvious:
    • In case your file system object is located on network resource, it cannot be put to recycle bin.
    • In case your file system object is located on a drive having no recycle bin folder (e.g. non-NTFS drive), it cannot be put to recycle bin.
    • In case your file system object is located on a drive with free space less than the object size, it cannot be put to recycle bin.



    Besides, that rec bin functionality is to be used explicitly by design, and the choice intentionally is up to end user. Because the user must be aware of the situation when disk space is about to be potentially wasted for a backup that nobody really needs.
    Best regards,
    Igor

  9. #9
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,049

    Re: How to tell if a file or a folder could be placed into the Recycle Bin?

    Quote Originally Posted by Igor Vartanov View Post
    * In case your file system object is located on a drive having no recycle bin folder (e.g. non-NTFS drive), it cannot be put to recycle bin.
    * In case your file system object is located on a drive with free space less than the object size, it cannot be put to recycle bin.
    neither of those 2 is correct.

    1)
    A FAT drive can have a recycle bin, and in fact dis so by default in Win95, 98, ME. THe use of FAT for harddisks has since been somewhat obsolete (mainly because of the limitations of FAT) but even today, a harddisk formatted as FAT on WIN8 has a recycle bin.

    THe presence of a recycled folder is a nontest.

    It may have such a folder where it is not in fact a recyclable folder (this could happen if you share your C: drive on a network, someone makking that share ad say Z: would see the recycled folder but it wouldn't be used for deleting from the network (it would be used when deleting files from the local machine).

    I've also seen USB sticks with a recycled folder, how it got there... I don't know.


    2)
    This too is nonvalid. Since the file is 'moved' into the recycled folder ON THE SAME DISK as where it is being removed from. deleting won't affect the free space before or after the operation.

    however, the recycled folder does have a size limit (default is 10% of the total disk capacity), so deleting any file larger than this capacity would not go into the recycle bin at all. YOu can change the limit by rightclicking on the recycle bin, and selecting properties.


    Besides, that rec bin functionality is to be used explicitly by design, and the choice intentionally is up to end user. Because the user must be aware of the situation when disk space is about to be potentially wasted for a backup that nobody really needs.
    but yes... THIS...
    stop working against the system, embrace what and how it does things rather than thinking you know better than the hundreds of designers at MS that made some of those decisions.

  10. #10
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,517

    Re: How to tell if a file or a folder could be placed into the Recycle Bin?

    Quote Originally Posted by OReubens View Post
    ...
    I've also seen USB sticks with a recycled folder, how it got there... I don't know.
    Then see https://www.google.com/search?source...lder&gs_htsa=1
    Victor Nijegorodov

  11. #11
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    828

    Re: How to tell if a file or a folder could be placed into the Recycle Bin?

    No, guys, there should be absolutely no guesswork involved in this. We're talking about potentially permanently deleting someone's files, and maybe even whole folders in a recursive fashion.

    Arjay, actually gave me a good hint. The documentation for SHFileOperation suggests using IFileOperation in one line of text. That seems to be a solution. (Unfortunately it takes more than one line of code to implement it.)

    All this time I was searching for a way to code that interface but all the examples I was able to come up with were pretty sketchy. So I'll post my entire working code sample here for anyone else who comes across this subject.

    Also before posting the code and the interface implementation, here's an overview in a nutshell. By implementing the IFileOperationProgressSink interface, you will have control over the entire deletion process, and namely, specific interface methods will be called before and after deleting each file. Luckily, the PreDeleteItem method will have the DWORD dwFlags parameter that will have the TSF_DELETE_RECYCLE_IF_POSSIBLE flag set if that specific item (file or folder) is being placed in the Recycle Bin. (That flag will not be set if the item is permanently deleted.) So your code can check, and if that flag is not on, simply react by either showing a user warning, or by automatically aborting the process.

    As an added bonus, you can also implement your own tracking of a lengthy deletion process by aborting it at your specific moment (which original SHFileOperation did not provide.)

    The only downside to my method below is that it is not available on Windows XP. So on that OS, you're stuck with SHFileOperation.

    OK, so having said that, now the "fun" part. I'm going to be using MFC for the COM wrapper. It will show the guts of the interface itself (in case Win32 people want to implement it as well.)

    First the method itself that is called to delete a folder or a file:
    (I'm using pseudo-code for brevity.)

    Code:
    BOOL DeleteToRecycleBin(LPCTSTR pStrItemPath)
    {
    	//Delete 'pStrItemPath' item into the Recycle Bin
    	//INFO: This method works on Vista and later OS!
    	//INFO: The item will be deleted only if it can be placed into the Recycle Bin.
    	//'pStrItemPath' = Full item path for a file or a folder to delete
    	//RETURN:
    	//		= TRUE if done
    	BOOL bRes = FALSE;
    
    	if(pStrItemPath &&
    		pStrItemPath[0] != 0)
    	{
    		//Make sure it's not a relative path
    		if(!PathIsRelative(pStrItemPath))
    		{
    			//Initialize COM as STA.
    			HRESULT hr = ::CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
    			if(SUCCEEDED(hr))
    			{
    				//Create the IFileOperation interface
    				CComPtr<IFileOperation> pfo;
    				if(SUCCEEDED(hr = CoCreateInstance(CLSID_FileOperation, NULL, CLSCTX_ALL, IID_PPV_ARGS(&pfo))))
    				{
    					//Set operation flags
    					if(SUCCEEDED(hr = pfo->SetOperationFlags(
    						FOF_ALLOWUNDO |
    						FOF_SILENT |
    						FOF_NOERRORUI | FOFX_EARLYFAILURE |
    						FOF_NO_UI
    						)))
    					{
    						//Create an IShellItem from the supplied path.
    						CComPtr<IShellItem> psiToDelete;
    						if(SUCCEEDED(hr = SHCreateItemFromParsingName(pStrItemPath, NULL, IID_PPV_ARGS(&psiToDelete))))
    						{
    							//Initialize our class with the IFileOperationProgressSink implementation
    							CRecycleBinOps* pThis = new CRecycleBinOps();
    
    							IFileOperationProgressSink* pSink = (IFileOperationProgressSink*)pThis->GetInterface(&IID_IFileOperationProgressSink);
    							if(pSink)
    							{
    								//Add the operation
    								if(SUCCEEDED(hr = pfo->DeleteItem(psiToDelete, pSink)))
    								{
    									//And perform the operation
    									if(SUCCEEDED(hr = pfo->PerformOperations()))
    									{
    										//Done
    										bRes = TRUE;
    									}
    								}
    							}
    
    							delete pThis;
    							pThis = NULL;
    						}
    					}
    				}
    
    				//Unit COM
    				::CoUninitialize();
    			}
    		}
    	}
    
    	return bRes;
    }
    And now the CRecycleBinOps class that implements the IFileOperationProgressSink interface that has all the callback methods we need:

    Code:
    //.h file
    class CRecycleBinOps : public CCmdTarget
    {
    public:
    	CRecycleBinOps();
    	~CRecycleBinOps(void);
    private:
    	DECLARE_INTERFACE_MAP();
    
    	BEGIN_INTERFACE_PART(Ifops, IFileOperationProgressSink)
            STDMETHOD(StartOperations)( void);
            STDMETHOD(FinishOperations)( 
                /* [in] */ HRESULT hrResult);
            STDMETHOD(PreRenameItem)( 
                /* [in] */ DWORD dwFlags,
                /* [in] */ __RPC__in_opt IShellItem *psiItem,
                /* [string][unique][in] */ __RPC__in_opt LPCWSTR pszNewName);
            STDMETHOD(PostRenameItem)( 
                /* [in] */ DWORD dwFlags,
                /* [in] */ __RPC__in_opt IShellItem *psiItem,
                /* [string][in] */ __RPC__in LPCWSTR pszNewName,
                /* [in] */ HRESULT hrRename,
                /* [in] */ __RPC__in_opt IShellItem *psiNewlyCreated);
            STDMETHOD(PreMoveItem)( 
                /* [in] */ DWORD dwFlags,
                /* [in] */ __RPC__in_opt IShellItem *psiItem,
                /* [in] */ __RPC__in_opt IShellItem *psiDestinationFolder,
                /* [string][unique][in] */ __RPC__in_opt LPCWSTR pszNewName);
            STDMETHOD(PostMoveItem)( 
                /* [in] */ DWORD dwFlags,
                /* [in] */ __RPC__in_opt IShellItem *psiItem,
                /* [in] */ __RPC__in_opt IShellItem *psiDestinationFolder,
                /* [string][unique][in] */ __RPC__in_opt LPCWSTR pszNewName,
                /* [in] */ HRESULT hrMove,
                /* [in] */ __RPC__in_opt IShellItem *psiNewlyCreated);
            STDMETHOD(PreCopyItem)( 
                /* [in] */ DWORD dwFlags,
                /* [in] */ __RPC__in_opt IShellItem *psiItem,
                /* [in] */ __RPC__in_opt IShellItem *psiDestinationFolder,
                /* [string][unique][in] */ __RPC__in_opt LPCWSTR pszNewName);
            STDMETHOD(PostCopyItem)( 
                /* [in] */ DWORD dwFlags,
                /* [in] */ __RPC__in_opt IShellItem *psiItem,
                /* [in] */ __RPC__in_opt IShellItem *psiDestinationFolder,
                /* [string][unique][in] */ __RPC__in_opt LPCWSTR pszNewName,
                /* [in] */ HRESULT hrCopy,
                /* [in] */ __RPC__in_opt IShellItem *psiNewlyCreated);
            STDMETHOD(PreDeleteItem)( 
                /* [in] */ DWORD dwFlags,
                /* [in] */ __RPC__in_opt IShellItem *psiItem);
            STDMETHOD(PostDeleteItem)( 
                /* [in] */ DWORD dwFlags,
                /* [in] */ __RPC__in_opt IShellItem *psiItem,
                /* [in] */ HRESULT hrDelete,
                /* [in] */ __RPC__in_opt IShellItem *psiNewlyCreated);
            STDMETHOD(PreNewItem)( 
                /* [in] */ DWORD dwFlags,
                /* [in] */ __RPC__in_opt IShellItem *psiDestinationFolder,
                /* [string][unique][in] */ __RPC__in_opt LPCWSTR pszNewName);
            STDMETHOD(PostNewItem)( 
                /* [in] */ DWORD dwFlags,
                /* [in] */ __RPC__in_opt IShellItem *psiDestinationFolder,
                /* [string][unique][in] */ __RPC__in_opt LPCWSTR pszNewName,
                /* [string][unique][in] */ __RPC__in_opt LPCWSTR pszTemplateName,
                /* [in] */ DWORD dwFileAttributes,
                /* [in] */ HRESULT hrNew,
                /* [in] */ __RPC__in_opt IShellItem *psiNewItem);
            STDMETHOD(UpdateProgress)( 
                /* [in] */ UINT iWorkTotal,
                /* [in] */ UINT iWorkSoFar);
            STDMETHOD(ResetTimer)( void);
            STDMETHOD(PauseTimer)( void);
            STDMETHOD(ResumeTimer)( void);
    	END_INTERFACE_PART(Ifops)
    };
    and the implementation part:
    Code:
    //.cpp file
    #include "StdAfx.h"
    #include "RecycleBinOps.h"
    
    CRecycleBinOps::CRecycleBinOps()
    {
    }
    
    CRecycleBinOps::~CRecycleBinOps(void)
    {
    }
    
    BEGIN_INTERFACE_MAP(CRecycleBinOps, CCmdTarget)
    		INTERFACE_PART(CRecycleBinOps, IID_IFileOperationProgressSink, Ifops)
    END_INTERFACE_MAP()
    
    ULONG CRecycleBinOps::XIfops::AddRef()
    {
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    	return pThis->ExternalAddRef();
    }
    
    ULONG CRecycleBinOps::XIfops::Release()
    {
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    	return pThis->ExternalRelease();
    }
    
    HRESULT CRecycleBinOps::XIfops::QueryInterface(REFIID riid, void ** ppvObj)
    {
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    	return pThis->ExternalQueryInterface( &riid, ppvObj );
    }
    
    HRESULT CRecycleBinOps::XIfops::StartOperations(void)
    {
    	//StartOperations is the first of the IFileOperationProgressSink methods to be called after PerformOperations. 
    	//It can be used to perform any setup or initialization that you require before the file operations begin.
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    
    	//If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
    	return S_OK;
    }
    
    HRESULT CRecycleBinOps::XIfops::FinishOperations( 
    	/* [in] */ HRESULT hrResult)
    {
    	//Performs caller-implemented actions after the last operation performed by the call to IFileOperation is complete.
    	//'hrResult' = final result of the operation
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    
    	return S_OK;
    }
    
    HRESULT CRecycleBinOps::XIfops::PreRenameItem( 
    	/* [in] */ DWORD dwFlags,
    	/* [in] */ __RPC__in_opt IShellItem *psiItem,
    	/* [string][unique][in] */ __RPC__in_opt LPCWSTR pszNewName)
    {
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    
    	return E_NOTIMPL;	//S_OK;
    }
    
    HRESULT CRecycleBinOps::XIfops::PostRenameItem( 
    	/* [in] */ DWORD dwFlags,
    	/* [in] */ __RPC__in_opt IShellItem *psiItem,
    	/* [string][in] */ __RPC__in LPCWSTR pszNewName,
    	/* [in] */ HRESULT hrRename,
    	/* [in] */ __RPC__in_opt IShellItem *psiNewlyCreated)
    {
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    
    	return E_NOTIMPL;	//S_OK;
    }
    
    HRESULT CRecycleBinOps::XIfops::PreMoveItem( 
    	/* [in] */ DWORD dwFlags,
    	/* [in] */ __RPC__in_opt IShellItem *psiItem,
    	/* [in] */ __RPC__in_opt IShellItem *psiDestinationFolder,
    	/* [string][unique][in] */ __RPC__in_opt LPCWSTR pszNewName)
    {
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    
    	return E_NOTIMPL;	//S_OK;
    }
    
    HRESULT CRecycleBinOps::XIfops::PostMoveItem( 
    	/* [in] */ DWORD dwFlags,
    	/* [in] */ __RPC__in_opt IShellItem *psiItem,
    	/* [in] */ __RPC__in_opt IShellItem *psiDestinationFolder,
    	/* [string][unique][in] */ __RPC__in_opt LPCWSTR pszNewName,
    	/* [in] */ HRESULT hrMove,
    	/* [in] */ __RPC__in_opt IShellItem *psiNewlyCreated)
    {
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    
    	return E_NOTIMPL;	//S_OK;
    }
    
    HRESULT CRecycleBinOps::XIfops::PreCopyItem( 
    	/* [in] */ DWORD dwFlags,
    	/* [in] */ __RPC__in_opt IShellItem *psiItem,
    	/* [in] */ __RPC__in_opt IShellItem *psiDestinationFolder,
    	/* [string][unique][in] */ __RPC__in_opt LPCWSTR pszNewName)
    {
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    
    	return E_NOTIMPL;	//S_OK;
    }
    
    HRESULT CRecycleBinOps::XIfops::PostCopyItem( 
    	/* [in] */ DWORD dwFlags,
    	/* [in] */ __RPC__in_opt IShellItem *psiItem,
    	/* [in] */ __RPC__in_opt IShellItem *psiDestinationFolder,
    	/* [string][unique][in] */ __RPC__in_opt LPCWSTR pszNewName,
    	/* [in] */ HRESULT hrCopy,
    	/* [in] */ __RPC__in_opt IShellItem *psiNewlyCreated)
    {
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    
    	return E_NOTIMPL;	//S_OK;
    }
    
    HRESULT CRecycleBinOps::XIfops::PreDeleteItem( 
    	/* [in] */ DWORD dwFlags,
    	/* [in] */ __RPC__in_opt IShellItem *psiItem)
    {
    	//Performs caller-implemented actions before the delete process for each item begins.
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    
    	//See if we're deleting into Recycle Bin
    	if(!(dwFlags & TSF_DELETE_RECYCLE_IF_POSSIBLE))
    	{
    		//We're not! Don't allow to continue
    		return E_ABORT;
    	}
    
    	//Returns S_OK if successful, or an error value otherwise. 
    	//In the case of an error value, the delete operation and all subsequent operations pending from the call to IFileOperation are canceled.
    	return S_OK;
    }
    
    HRESULT CRecycleBinOps::XIfops::PostDeleteItem( 
    	/* [in] */ DWORD dwFlags,
    	/* [in] */ __RPC__in_opt IShellItem *psiItem,
    	/* [in] */ HRESULT hrDelete,
    	/* [in] */ __RPC__in_opt IShellItem *psiNewlyCreated)
    {
    	//Performs caller-implemented actions after the delete process for each item is complete.
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    
    	//Here if you want to see if this item was permanently deleted
    	//do this post-op check:
    	if(psiNewlyCreated == NULL)
    	{
    		//This item was permanently deleted
    		//Note that at this point the file/folder is already gone!
    	}
    
    	//Returns S_OK if successful, or an error value otherwise. 
    	//In the case of an error value, all subsequent operations pending from the call to IFileOperation are canceled.
    	return S_OK;
    }
    
    HRESULT CRecycleBinOps::XIfops::PreNewItem( 
    	/* [in] */ DWORD dwFlags,
    	/* [in] */ __RPC__in_opt IShellItem *psiDestinationFolder,
    	/* [string][unique][in] */ __RPC__in_opt LPCWSTR pszNewName)
    {
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    
    	return E_NOTIMPL;	//S_OK;
    }
    
    HRESULT CRecycleBinOps::XIfops::PostNewItem( 
    	/* [in] */ DWORD dwFlags,
    	/* [in] */ __RPC__in_opt IShellItem *psiDestinationFolder,
    	/* [string][unique][in] */ __RPC__in_opt LPCWSTR pszNewName,
    	/* [string][unique][in] */ __RPC__in_opt LPCWSTR pszTemplateName,
    	/* [in] */ DWORD dwFileAttributes,
    	/* [in] */ HRESULT hrNew,
    	/* [in] */ __RPC__in_opt IShellItem *psiNewItem)
    {
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    
    	return E_NOTIMPL;	//S_OK;
    }
    
    HRESULT CRecycleBinOps::XIfops::UpdateProgress( 
    	/* [in] */ UINT iWorkTotal,
    	/* [in] */ UINT iWorkSoFar)
    {
    	//Provides an estimate of the total amount of work currently done in relation to the total amount of work.
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    
    	//For more details on this method and the meaning of these parameters check MSDN:
    	//	http://msdn.microsoft.com/en-us/library/windows/desktop/bb775753(v=vs.85).aspx
    
    	//If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
    	return S_OK;
    }
    
    HRESULT CRecycleBinOps::XIfops::ResetTimer( void)
    {
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    
    	return E_NOTIMPL;	//S_OK;
    }
    
    HRESULT CRecycleBinOps::XIfops::PauseTimer( void)
    {
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    
    	return E_NOTIMPL;	//S_OK;
    }
    
    HRESULT CRecycleBinOps::XIfops::ResumeTimer( void)
    {
    	METHOD_PROLOGUE(CRecycleBinOps, Ifops);
    
    	return E_NOTIMPL;	//S_OK;
    }
    I know it's a lot of code, but I couldn't seem to find a simpler solution. If anyone wants to add anything to it, feel free to post below.

  12. #12
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,418

    Re: How to tell if a file or a folder could be placed into the Recycle Bin?

    Quote Originally Posted by dc_2000 View Post
    OK, so having said that, now the "fun" part. I'm going to be using MFC for the COM wrapper.
    Check out doing the COM stuff with ATL (as MFC is extremely clunky for doing anything COM).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center