src/wfcomman.c
/////////////////////////////////////////////////////////////////////
//
// Name:     CreateDirWindow
//
// Synopsis:
//
//      szPath          fully qualified path with no filespec
//      bReplaceOpen    default replacement mode, shift always toggles this
//      hwndActive      active mdi child that we are working on
//
// Return:   hwnd of window created or of existing dir window that we
//           activated or replaced if replace on open was active
//
//
// Assumes:
//
// Effects:
//
//
// Notes:
//
/////////////////////////////////////////////////////////////////////



szPath          fully qualified path with no filespec
bReplaceOpen    default replacement mode, shift always toggles this
hwndActive      active mdi child that we are working on

hwnd of window created or of existing dir window that we
activated or replaced if replace on open was active






szPath fully qualified path with no filespec bReplaceOpen default replacement mode shift always toggles this hwndActive active mdi child that we are working on hwnd of window created or of existing dir window that we activated or replaced if replace on open was active
HWND
CreateDirWindow(
   register LPWSTR szPath,
   BOOL bReplaceOpen,
   HWND hwndActive)
{
   register HWND hwndT;
   WCHAR szFileSpec[MAXPATHLEN];
   if (GetKeyState(VK_SHIFT) < 0)
      bReplaceOpen = !bReplaceOpen;
   if (!bReplaceOpen && (hwndT = LocateDirWindow(szPath, TRUE, TRUE))) {
      SendMessage(hwndMDIClient, WM_MDIACTIVATE, GET_WM_MDIACTIVATE_MPS(0, 0, hwndT));
      if (IsIconic(hwndT))
         SendMessage(hwndT, WM_SYSCOMMAND, SC_RESTORE, 0L);
      return hwndT;
   }
   if (bReplaceOpen) {
      if (hwndT = HasTreeWindow(hwndActive))
         SendMessage(hwndT, TC_SETDIRECTORY, FALSE, (LPARAM)szPath);
      SendMessage(hwndActive,
                  FS_GETFILESPEC,
                  COUNTOF(szFileSpec),
                  (LPARAM)szFileSpec);
      AddBackslash(szPath);
      lstrcat(szPath, szFileSpec);
      SendMessage(GetDlgItem(hwndActive, IDCW_DIR), FS_CHANGEDISPLAY, CD_PATH, (LPARAM)szPath);
      UpdateStatus(hwndActive);
      return hwndActive;
   }
   AddBackslash(szPath);                   
   lstrcat(szPath, szStarDotStar);
   return CreateTreeWindow(szPath, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, 0);
}
HWND CreateDirWindow ( register LPWSTR szPath , BOOL bReplaceOpen , HWND hwndActive ) { register HWND hwndT ; WCHAR szFileSpec [ MAXPATHLEN ] ; if ( GetKeyState ( VK_SHIFT ) < 0 ) bReplaceOpen = ! bReplaceOpen ; if ( ! bReplaceOpen && ( hwndT = LocateDirWindow ( szPath , TRUE , TRUE ) ) ) { SendMessage ( hwndMDIClient , WM_MDIACTIVATE , GET_WM_MDIACTIVATE_MPS ( 0 , 0 , hwndT ) ) ; if ( IsIconic ( hwndT ) ) SendMessage ( hwndT , WM_SYSCOMMAND , SC_RESTORE , 0L ) ; return hwndT ; } if ( bReplaceOpen ) { if ( hwndT = HasTreeWindow ( hwndActive ) ) SendMessage ( hwndT , TC_SETDIRECTORY , FALSE , ( LPARAM ) szPath ) ; SendMessage ( hwndActive , FS_GETFILESPEC , COUNTOF ( szFileSpec ) , ( LPARAM ) szFileSpec ) ; AddBackslash ( szPath ) ; lstrcat ( szPath , szFileSpec ) ; SendMessage ( GetDlgItem ( hwndActive , IDCW_DIR ) , FS_CHANGEDISPLAY , CD_PATH , ( LPARAM ) szPath ) ; UpdateStatus ( hwndActive ) ; return hwndActive ; } AddBackslash ( szPath ) ; lstrcat ( szPath , szStarDotStar ) ; return CreateTreeWindow ( szPath , CW_USEDEFAULT , 0 , CW_USEDEFAULT , 0 , 0 ) ; }
Name:     CreateDirWindow
Synopsis:
Name : CreateDirWindow Synopsis :
//
 // shift toggles 'replace on open'
 //
 //
 // Is a window with this path already open?
 //
 //
 // Are we replacing the contents of the currently active child?
 //
 //
 // update the tree if necessary, before we throw on the filespec
 //
 //
 // need to add this stuff to the path
 //
 //
 // Update the status in case we are "reading"
 //
 // default to all files
 //
 // dir only tree window
 //
