Changeset 1041 for trunk/dll/dircnrs.c


Ignore:
Timestamp:
Jul 7, 2008, 1:30:30 AM (17 years ago)
Author:
Gregg Young
Message:

Adds optional support for delete being move to X/Eworkplace trashcan (ticket 43)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/dircnrs.c

    r1039 r1041  
    4040  21 Jun 08 GKY Fix columns to honor preferences on new container open.
    4141  22 Jun 08 GKY Included free_... functions for fortify checking
     42  06 Jul 08 GKY Update delete/undelete to include move to and open XWP trashcan
    4243
    4344***********************************************************************/
     
    5354#define INCL_DOSERRORS
    5455#define INCL_LONGLONG
     56#define INCL_WINWORKPLACE
    5557
    5658#include "fm3dlg.h"
     
    20352037        {
    20362038          PCNRITEM pci;
    2037           CHAR path[CCHMAXPATH];
    2038 
    2039           pci = (PCNRITEM) CurrentRecord(hwnd);
    2040           if (pci && (INT) pci != -1) {
    2041             strcpy(path, pci->pszFileName);
    2042             MakeValidDir(path);
    2043             WinDlgBox(HWND_DESKTOP, hwnd, UndeleteDlgProc, FM3ModHandle,
    2044                       UNDEL_FRAME, MPFROMP(path));
     2039          CHAR path[CCHMAXPATH];
     2040          HOBJECT hObject;
     2041          HWND hwndDesktop;
     2042
     2043          hObject = WinQueryObject("<XWP_TRASHCAN>");
     2044          if (hObject != NULLHANDLE && fTrashCan) {
     2045            hwndDesktop = WinQueryDesktopWindow((HAB) 0, NULLHANDLE);
     2046            WinSetFocus(HWND_DESKTOP, hwndDesktop);
     2047            WinOpenObject(hObject, 0, TRUE);
     2048          }
     2049          else {
     2050            pci = (PCNRITEM) CurrentRecord(hwnd);
     2051            if (pci && (INT) pci != -1) {
     2052              strcpy(path, pci->pszFileName);
     2053              MakeValidDir(path);
     2054              WinDlgBox(HWND_DESKTOP, hwnd, UndeleteDlgProc, FM3ModHandle,
     2055                        UNDEL_FRAME, MPFROMP(path));
     2056            }
    20452057          }
    20462058        }
     
    20482060
    20492061      case IDM_UNDELETESPEC:
    2050         WinDlgBox(HWND_DESKTOP,
    2051                   hwnd,
    2052                   UndeleteDlgProc,
    2053                   FM3ModHandle, UNDEL_FRAME, MPFROMP(dcd->directory));
    2054         break;
     2062        {
     2063          HOBJECT hObject;
     2064          HWND hwndDesktop;
     2065
     2066          hObject = WinQueryObject("<XWP_TRASHCAN>");
     2067          if (hObject != NULLHANDLE && fTrashCan) {
     2068            hwndDesktop = WinQueryDesktopWindow((HAB) 0, NULLHANDLE);
     2069            WinSetFocus(HWND_DESKTOP, hwndDesktop);
     2070            WinOpenObject(hObject, 0, TRUE);
     2071          }
     2072        else
     2073          WinDlgBox(HWND_DESKTOP,
     2074                    hwnd,
     2075                    UndeleteDlgProc,
     2076                    FM3ModHandle, UNDEL_FRAME, MPFROMP(dcd->directory));
     2077        }
     2078        break;
    20552079
    20562080      case IDM_RESORT:
Note: See TracChangeset for help on using the changeset viewer.