src/wfcomman.c
/////////////////////////////////////////////////////////////////////
//
// Name:     CreateTreeWindow
//
// Synopsis: Creates a tree window
//
//           szPath  fully qualified ANSI path name WITH filespec
//           nSplit split position of tree and dir windows, if this is
//                   less than the threshold a tree will not be created,
//                   if it is more then a dir will not be created.
//                   0 to create a dir only
//                   very large number for tree only
//                   < 0 to have the split put in the middle
//
// Return:   hwnd of the MDI child created
//
//
// Assumes:
//
// Effects:
//
//
// Notes:
//
/////////////////////////////////////////////////////////////////////

CreateTreeWindow
Synopsis: Creates a tree window

szPath  fully qualified ANSI path name WITH filespec
nSplit split position of tree and dir windows, if this is
less than the threshold a tree will not be created,
if it is more then a dir will not be created.
0 to create a dir only
very large number for tree only
< 0 to have the split put in the middle

hwnd of the MDI child created






CreateTreeWindow Synopsis : Creates a tree window szPath fully qualified ANSI path name WITH filespec nSplit split position of tree and dir windows if this is less than the threshold a tree will not be created if it is more then a dir will not be created . 0 to create a dir only very large number for tree only < 0 to have the split put in the middle hwnd of the MDI child created
HWND
CreateTreeWindow(
   LPWSTR szPath,
   INT x,
   INT y,
   INT dx,
   INT dy,
   INT dxSplit)
{
   MDICREATESTRUCT MDICS;
   HWND hwnd;
   if (iNumWindows > 26) {
      LoadString(hAppInstance, IDS_WINFILE, szTitle, COUNTOF(szTitle));
      LoadString(hAppInstance, IDS_TOOMANYWINDOWS, szMessage, COUNTOF(szMessage));
      MessageBox(hwndFrame, szMessage, szTitle, MB_OK | MB_ICONEXCLAMATION);
      return NULL;
   }
   MDICS.szClass = szTreeClass;
   MDICS.szTitle = szPath;
   MDICS.hOwner = hAppInstance;
   MDICS.style = 0L;
   MDICS.x  = x;
   MDICS.y  = y;
   MDICS.cx = dx;
   MDICS.cy = dy;
   MDICS.lParam = dxSplit;
   hwnd = (HWND)SendMessage(hwndMDIClient, WM_MDIGETACTIVE, 0, 0L);
   if (hwnd && GetWindowLong(hwnd, GWL_STYLE) & WS_MAXIMIZE)
      MDICS.style |= WS_MAXIMIZE;
   hwnd = (HWND)SendMessage(hwndMDIClient,
                            WM_MDICREATE,
                            0L, (LPARAM)&MDICS);
   SetWindowLong(hwnd, GWL_VIEW, dwNewView);
   SetWindowLong(hwnd, GWL_SORT, dwNewSort);
   SetWindowLong(hwnd, GWL_ATTRIBS, dwNewAttribs);
   return hwnd;
}
HWND CreateTreeWindow ( LPWSTR szPath , INT x , INT y , INT dx , INT dy , INT dxSplit ) { MDICREATESTRUCT MDICS ; HWND hwnd ; if ( iNumWindows > 26 ) { LoadString ( hAppInstance , IDS_WINFILE , szTitle , COUNTOF ( szTitle ) ) ; LoadString ( hAppInstance , IDS_TOOMANYWINDOWS , szMessage , COUNTOF ( szMessage ) ) ; MessageBox ( hwndFrame , szMessage , szTitle , MB_OK | MB_ICONEXCLAMATION ) ; return NULL ; } MDICS . szClass = szTreeClass ; MDICS . szTitle = szPath ; MDICS . hOwner = hAppInstance ; MDICS . style = 0L ; MDICS . x = x ; MDICS . y = y ; MDICS . cx = dx ; MDICS . cy = dy ; MDICS . lParam = dxSplit ; hwnd = ( HWND ) SendMessage ( hwndMDIClient , WM_MDIGETACTIVE , 0 , 0L ) ; if ( hwnd && GetWindowLong ( hwnd , GWL_STYLE ) & WS_MAXIMIZE ) MDICS . style |= WS_MAXIMIZE ; hwnd = ( HWND ) SendMessage ( hwndMDIClient , WM_MDICREATE , 0L , ( LPARAM ) & MDICS ) ; SetWindowLong ( hwnd , GWL_VIEW , dwNewView ) ; SetWindowLong ( hwnd , GWL_SORT , dwNewSort ) ; SetWindowLong ( hwnd , GWL_ATTRIBS , dwNewAttribs ) ; return hwnd ; }
Name:     CreateTreeWindow
Synopsis: Creates a tree window
Name : CreateTreeWindow Synopsis : Creates a tree window
//
 // this saves people from creating more windows than they should
 // note, when the mdi window is maximized many people don't reallize
 // how many windows they have openend.
 //
 //
 // Create the Directory Tree window
 //
 //
 // Set all the view/sort/include parameters.  This is to make
 // sure these values get initialized in the case when there is
 // no directory window.
 //
