Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/windirstat.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Schneider <oliver@assarbad.net>2017-01-10 00:46:40 +0300
committerOliver Schneider <oliver@assarbad.net>2017-01-10 00:46:40 +0300
commit7ec44caad3fdc9fa92312e82b3d2a7200615a39a (patch)
treec6012b7a93df84af05a7362ebc6e1eb646c19b07 /windirstat
parentc40cbf3095e4c769d80c6837476a7b0fb452fbf0 (diff)
All source files now with LF line endings again
Updated the logo files a bit, renamed some others
Diffstat (limited to 'windirstat')
-rw-r--r--windirstat/Controls/ColorButton.cpp2
-rw-r--r--windirstat/Controls/ColorButton.h2
-rw-r--r--windirstat/Controls/TreeListControl.cpp2
-rw-r--r--windirstat/Controls/TreeListControl.h2
-rw-r--r--windirstat/Controls/graphview.cpp2
-rw-r--r--windirstat/Controls/graphview.h2
-rw-r--r--windirstat/Controls/myimagelist.cpp2
-rw-r--r--windirstat/Controls/myimagelist.h2
-rw-r--r--windirstat/Controls/ownerdrawnlistcontrol.cpp2
-rw-r--r--windirstat/Controls/ownerdrawnlistcontrol.h2
-rw-r--r--windirstat/Controls/pacman.cpp2
-rw-r--r--windirstat/Controls/pacman.h2
-rw-r--r--windirstat/Controls/sortinglistcontrol.cpp634
-rw-r--r--windirstat/Controls/sortinglistcontrol.h222
-rw-r--r--windirstat/Controls/treemap.cpp2
-rw-r--r--windirstat/Controls/treemap.h2
-rw-r--r--windirstat/Controls/typeview.cpp2
-rw-r--r--windirstat/Controls/typeview.h2
-rw-r--r--windirstat/Controls/xyslider.cpp2
-rw-r--r--windirstat/Controls/xyslider.h2
-rw-r--r--windirstat/Dialogs/AboutDlg.h2
-rw-r--r--windirstat/Dialogs/DeleteWarningDlg.cpp2
-rw-r--r--windirstat/Dialogs/DeleteWarningDlg.h2
-rw-r--r--windirstat/Dialogs/SelectDrivesDlg.cpp2
-rw-r--r--windirstat/Dialogs/SelectDrivesDlg.h2
-rw-r--r--windirstat/Dialogs/aboutdlg.cpp2
-rw-r--r--windirstat/FileFindWDS.cpp2
-rw-r--r--windirstat/FileFindWDS.h2
-rw-r--r--windirstat/ModalApiShuttle.cpp2
-rw-r--r--windirstat/ModalApiShuttle.h2
-rw-r--r--windirstat/ModalShellApi.cpp2
-rw-r--r--windirstat/ModalShellApi.h2
-rw-r--r--windirstat/PageCleanups.cpp2
-rw-r--r--windirstat/PageCleanups.h2
-rw-r--r--windirstat/PageGeneral.cpp2
-rw-r--r--windirstat/PageGeneral.h2
-rw-r--r--windirstat/PageTreelist.cpp2
-rw-r--r--windirstat/PageTreelist.h2
-rw-r--r--windirstat/PageTreemap.cpp2
-rw-r--r--windirstat/PageTreemap.h2
-rw-r--r--windirstat/WDS_Lua_C.c122
-rw-r--r--windirstat/WDS_Lua_C.h80
-rw-r--r--windirstat/WorkLimiter.cpp120
-rw-r--r--windirstat/WorkLimiter.h48
-rw-r--r--windirstat/dirstatdoc.cpp2
-rw-r--r--windirstat/dirstatdoc.h2
-rw-r--r--windirstat/dirstatview.cpp902
-rw-r--r--windirstat/dirstatview.h210
-rw-r--r--windirstat/getosplatformstring.cpp2
-rw-r--r--windirstat/getosplatformstring.h2
-rw-r--r--windirstat/globalhelpers.cpp2
-rw-r--r--windirstat/globalhelpers.h2
-rw-r--r--windirstat/helpmap.h2
-rw-r--r--windirstat/item.cpp2
-rw-r--r--windirstat/item.h2
-rw-r--r--windirstat/layout.cpp2
-rw-r--r--windirstat/layout.h2
-rw-r--r--windirstat/mainframe.cpp2454
-rw-r--r--windirstat/mainframe.h490
-rw-r--r--windirstat/mountpoints.cpp2
-rw-r--r--windirstat/mountpoints.h2
-rw-r--r--windirstat/options.cpp2
-rw-r--r--windirstat/options.h2
-rw-r--r--windirstat/osspecific.cpp2
-rw-r--r--windirstat/osspecific.h2
-rw-r--r--windirstat/selectobject.h2
-rw-r--r--windirstat/set.h2
-rw-r--r--windirstat/stdafx.cpp2
-rw-r--r--windirstat/stdafx.h2
-rw-r--r--windirstat/windirstat.cpp1566
-rw-r--r--windirstat/windirstat.h2
-rw-r--r--windirstat/windirstat.vs14.vcxproj387
-rw-r--r--windirstat/windirstat.vs14.vcxproj.filters348
-rw-r--r--windirstat/windirstat.vs8.vcproj832
74 files changed, 4222 insertions, 4313 deletions
diff --git a/windirstat/Controls/ColorButton.cpp b/windirstat/Controls/ColorButton.cpp
index 4bf3617..632a734 100644
--- a/windirstat/Controls/ColorButton.cpp
+++ b/windirstat/Controls/ColorButton.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "colorbutton.h"
diff --git a/windirstat/Controls/ColorButton.h b/windirstat/Controls/ColorButton.h
index 1afdd9e..a174a62 100644
--- a/windirstat/Controls/ColorButton.h
+++ b/windirstat/Controls/ColorButton.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_COLORBUTTON_H__
#define __WDS_COLORBUTTON_H__
diff --git a/windirstat/Controls/TreeListControl.cpp b/windirstat/Controls/TreeListControl.cpp
index 362b19c..ba1ba10 100644
--- a/windirstat/Controls/TreeListControl.cpp
+++ b/windirstat/Controls/TreeListControl.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/Controls/TreeListControl.h b/windirstat/Controls/TreeListControl.h
index 8e47863..b9d1a48 100644
--- a/windirstat/Controls/TreeListControl.h
+++ b/windirstat/Controls/TreeListControl.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_TREELISTCONTROL_H__
#define __WDS_TREELISTCONTROL_H__
diff --git a/windirstat/Controls/graphview.cpp b/windirstat/Controls/graphview.cpp
index 19601e4..db72836 100644
--- a/windirstat/Controls/graphview.cpp
+++ b/windirstat/Controls/graphview.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/Controls/graphview.h b/windirstat/Controls/graphview.h
index c97adb6..356a6f8 100644
--- a/windirstat/Controls/graphview.h
+++ b/windirstat/Controls/graphview.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_GRAPHVIEW_H__
#define __WDS_GRAPHVIEW_H__
diff --git a/windirstat/Controls/myimagelist.cpp b/windirstat/Controls/myimagelist.cpp
index 656a276..961dcce 100644
--- a/windirstat/Controls/myimagelist.cpp
+++ b/windirstat/Controls/myimagelist.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/Controls/myimagelist.h b/windirstat/Controls/myimagelist.h
index e373971..851067b 100644
--- a/windirstat/Controls/myimagelist.h
+++ b/windirstat/Controls/myimagelist.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_MYIMAGELIST_H__
#define __WDS_MYIMAGELIST_H__
diff --git a/windirstat/Controls/ownerdrawnlistcontrol.cpp b/windirstat/Controls/ownerdrawnlistcontrol.cpp
index 4347f98..48f6c8b 100644
--- a/windirstat/Controls/ownerdrawnlistcontrol.cpp
+++ b/windirstat/Controls/ownerdrawnlistcontrol.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/Controls/ownerdrawnlistcontrol.h b/windirstat/Controls/ownerdrawnlistcontrol.h
index 511974e..3701d8e 100644
--- a/windirstat/Controls/ownerdrawnlistcontrol.h
+++ b/windirstat/Controls/ownerdrawnlistcontrol.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_OWNERDRAWNLISTCONTROL_H__
#define __WDS_OWNERDRAWNLISTCONTROL_H__
diff --git a/windirstat/Controls/pacman.cpp b/windirstat/Controls/pacman.cpp
index 7d16f89..ca95dd6 100644
--- a/windirstat/Controls/pacman.cpp
+++ b/windirstat/Controls/pacman.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "pacman.h"
diff --git a/windirstat/Controls/pacman.h b/windirstat/Controls/pacman.h
index e389143..01e4fd5 100644
--- a/windirstat/Controls/pacman.h
+++ b/windirstat/Controls/pacman.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_PACMAN_H__
#define __WDS_PACMAN_H__
diff --git a/windirstat/Controls/sortinglistcontrol.cpp b/windirstat/Controls/sortinglistcontrol.cpp
index 0c6648f..6de005b 100644
--- a/windirstat/Controls/sortinglistcontrol.cpp
+++ b/windirstat/Controls/sortinglistcontrol.cpp
@@ -1,317 +1,317 @@
-// sortinglistcontrol.cpp - Implementation of CSortingListItem and CSortingListControl
-//
-// WinDirStat - Directory Statistics
-// Copyright (C) 2003-2005 Bernhard Seifert
-// Copyright (C) 2004-2016 WinDirStat team (windirstat.info)
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-//
-
-#include "stdafx.h"
-#include "windirstat.h"
-#include "sortinglistcontrol.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-
-CString CSortingListItem::GetText(int subitem) const
-{
- // Dummy implementation
- CString s;
- s.Format(_T("subitem %d"), subitem);
- return s;
-}
-
-int CSortingListItem::GetImage() const
-{
- // Dummy implementation
- return 0;
-}
-
-// Return value:
-// <= -2: this is less than other regardless of ascending flag
-// -1: this is less than other
-// 0: this equals other
-// +1: this is greater than other
-// >= +1: this is greater than other regardless of ascending flag.
-//
-int CSortingListItem::Compare(const CSortingListItem *other, int subitem) const
-{
- // Default implementation compares strings
- return signum(GetText(subitem).CompareNoCase(other->GetText(subitem)));
-}
-
-// TODO: check how suitable those are for Unicode-only strings (say Russian)
-int CSortingListItem::CompareS(const CSortingListItem *other, const SSorting& sorting) const
-{
- int r = Compare(other, sorting.column1);
- if(abs(r) < 2 && !sorting.ascending1)
- {
- r = -r;
- }
-
- if(r == 0 && sorting.column2 != sorting.column1)
- {
- r = Compare(other, sorting.column2);
- if(abs(r) < 2 && !sorting.ascending2)
- {
- r = -r;
- }
- }
- return r;
-}
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-IMPLEMENT_DYNAMIC(CSortingListControl, CListCtrl)
-
-CSortingListControl::CSortingListControl(LPCTSTR name)
-{
- m_name = name;
- m_indicatedColumn = -1;
-}
-
-CSortingListControl::~CSortingListControl()
-{
-}
-
-void CSortingListControl::LoadPersistentAttributes()
-{
- int i = 0;
- CArray<int, int> arr;
- arr.SetSize(GetHeaderCtrl()->GetItemCount());
-
- GetColumnOrderArray(arr.GetData(), arr.GetSize());
- CPersistence::GetColumnOrder(m_name, arr);
- SetColumnOrderArray(int(arr.GetSize()), arr.GetData());
-
- for(i = 0; i < arr.GetSize(); i++)
- {
- arr[i]= GetColumnWidth(i);
- }
- CPersistence::GetColumnWidths(m_name, arr);
- for(i = 0; i < arr.GetSize(); i++)
- {
- // To avoid "insane" settings we set the column width to
- // maximal twice the default width.
- int maxWidth = GetColumnWidth(i) * 2;
- int w = min(arr[i], maxWidth);
- SetColumnWidth(i, w);
- }
-
- // Not so good: CPersistence::GetSorting(m_name, GetHeaderCtrl()->GetItemCount(), m_sorting.column1, m_sorting.ascending1, m_sorting.column2, m_sorting.ascending2);
- // We refrain from saving the sorting because it is too likely, that
- // users start up with insane settings and don't get it.
-}
-
-void CSortingListControl::SavePersistentAttributes()
-{
- CArray<int, int> arr;
- arr.SetSize(GetHeaderCtrl()->GetItemCount());
-
- GetColumnOrderArray(arr.GetData(), arr.GetSize());
- CPersistence::SetColumnOrder(m_name, arr);
-
- for(int i = 0; i < arr.GetSize(); i++)
- {
- arr[i]= GetColumnWidth(i);
- }
- CPersistence::SetColumnWidths(m_name, arr);
-
- // Not so good: CPersistence::SetSorting(m_name, m_sorting.column1, m_sorting.ascending1, m_sorting.column2, m_sorting.ascending2);
-}
-
-void CSortingListControl::AddExtendedStyle(DWORD exStyle)
-{
- SetExtendedStyle(GetExtendedStyle() | exStyle);
-}
-
-void CSortingListControl::RemoveExtendedStyle(DWORD exStyle)
-{
- SetExtendedStyle(GetExtendedStyle() & ~exStyle);
-}
-
-
-const SSorting& CSortingListControl::GetSorting()
-{
- return m_sorting;
-}
-
-void CSortingListControl::SetSorting(const SSorting& sorting)
-{
- m_sorting = sorting;
-}
-
-void CSortingListControl::SetSorting(int sortColumn1, bool ascending1, int sortColumn2, bool ascending2)
-{
- m_sorting.column1 = sortColumn1;
- m_sorting.ascending1 = ascending1;
- m_sorting.column2 = sortColumn2;
- m_sorting.ascending2 = ascending2;
-}
-
-void CSortingListControl::SetSorting(int sortColumn, bool ascending)
-{
- m_sorting.column2 = m_sorting.column1;
- m_sorting.ascending2 = m_sorting.ascending1;
- m_sorting.column1 = sortColumn;
- m_sorting.ascending1 = ascending;
-}
-
-void CSortingListControl::InsertListItem(int i, CSortingListItem *item)
-{
- LVITEM lvitem;
- ZeroMemory(&lvitem, sizeof(lvitem));
-
- lvitem.mask = LVIF_TEXT | LVIF_PARAM;
- if(HasImages())
- {
- lvitem.mask |= LVIF_IMAGE;
- }
-
- lvitem.iItem = i;
- lvitem.pszText = LPSTR_TEXTCALLBACK;
- lvitem.iImage = I_IMAGECALLBACK;
- lvitem.lParam = (LPARAM)item;
-
- VERIFY(i == CListCtrl::InsertItem(&lvitem));
-}
-
-CSortingListItem *CSortingListControl::GetSortingListItem(int i)
-{
- return (CSortingListItem *)GetItemData(i);
-}
-
-void CSortingListControl::SortItems()
-{
- VERIFY(CListCtrl::SortItems(&_CompareFunc, (DWORD_PTR)&m_sorting));
-
- HDITEM hditem;
- ZeroMemory(&hditem, sizeof(hditem));
-
- if(m_indicatedColumn != -1)
- {
- CString text;
- hditem.mask = HDI_TEXT;
- hditem.pszText = text.GetBuffer(256);
- hditem.cchTextMax = 256;
- GetHeaderCtrl()->GetItem(m_indicatedColumn, &hditem);
- text.ReleaseBuffer();
- text = text.Mid(2);
- hditem.pszText = (LPTSTR)(LPCTSTR)text;
- GetHeaderCtrl()->SetItem(m_indicatedColumn, &hditem);
- }
-
- CString text;
- hditem.mask = HDI_TEXT;
- hditem.pszText = text.GetBuffer(256);
- hditem.cchTextMax = 256;
- GetHeaderCtrl()->GetItem(m_sorting.column1, &hditem);
- text.ReleaseBuffer();
- text = (m_sorting.ascending1 ? _T("< ") : _T("> ")) + text;
- hditem.pszText = (LPTSTR)(LPCTSTR)text;
- GetHeaderCtrl()->SetItem(m_sorting.column1, &hditem);
- m_indicatedColumn = m_sorting.column1;
-}
-
-bool CSortingListControl::GetAscendingDefault(int /*column*/)
-{
- return true;
-}
-
-bool CSortingListControl::HasImages()
-{
- return false;
-}
-
-# if (_MFC_VER <=0x0800)
-BOOL CSortingListControl::GetColumnOrderArray(LPINT piArray, INT_PTR iCount)
-{
- ASSERT(iCount <= INT_MAX);
- return dynamic_cast<CListCtrl*>(this)->GetColumnOrderArray(piArray, (int)iCount);
-}
-# endif
-
-int CALLBACK CSortingListControl::_CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
-{
- CSortingListItem *item1 = (CSortingListItem *)lParam1;
- CSortingListItem *item2 = (CSortingListItem *)lParam2;
- SSorting *sorting = (SSorting *)lParamSort;
-
- return item1->CompareS(item2, *sorting);
-}
-
-BEGIN_MESSAGE_MAP(CSortingListControl, CListCtrl)
- ON_NOTIFY_REFLECT(LVN_GETDISPINFO, OnLvnGetdispinfo)
- ON_NOTIFY(HDN_ITEMCLICKA, 0, OnHdnItemclick)
- ON_NOTIFY(HDN_ITEMCLICKW, 0, OnHdnItemclick)
- ON_NOTIFY(HDN_ITEMDBLCLICKA, 0, OnHdnItemdblclick)
- ON_NOTIFY(HDN_ITEMDBLCLICKW, 0, OnHdnItemdblclick)
- ON_WM_DESTROY()
-END_MESSAGE_MAP()
-
-void CSortingListControl::OnLvnGetdispinfo(NMHDR *pNMHDR, LRESULT *pResult)
-{
- NMLVDISPINFO *di = reinterpret_cast<NMLVDISPINFO*>(pNMHDR);
- *pResult = 0;
-
- CSortingListItem *item = (CSortingListItem *)(di->item.lParam);
-
- if((di->item.mask & LVIF_TEXT) != 0)
- {
- _tcscpy_s(di->item.pszText, di->item.cchTextMax, item->GetText(di->item.iSubItem));
- }
-
- if((di->item.mask & LVIF_IMAGE) != 0)
- {
- di->item.iImage = item->GetImage();
- }
-}
-
-void CSortingListControl::OnHdnItemclick(NMHDR *pNMHDR, LRESULT *pResult)
-{
- LPNMHEADER phdr = reinterpret_cast<LPNMHEADER>(pNMHDR);
- *pResult = 0;
- const int col = phdr->iItem;
-
- if(col == m_sorting.column1)
- {
- m_sorting.ascending1 = !m_sorting.ascending1;
- }
- else
- {
- SetSorting(col, GetAscendingDefault(col));
- }
-
- SortItems();
-}
-
-
-void CSortingListControl::OnHdnItemdblclick(NMHDR *pNMHDR, LRESULT *pResult)
-{
- OnHdnItemclick(pNMHDR, pResult);
-}
-
-void CSortingListControl::OnDestroy()
-{
- SavePersistentAttributes();
- CListCtrl::OnDestroy();
-}
+// sortinglistcontrol.cpp - Implementation of CSortingListItem and CSortingListControl
+//
+// WinDirStat - Directory Statistics
+// Copyright (C) 2003-2005 Bernhard Seifert
+// Copyright (C) 2004-2016 WinDirStat team (windirstat.info)
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+//
+
+#include "stdafx.h"
+#include "windirstat.h"
+#include "sortinglistcontrol.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+
+CString CSortingListItem::GetText(int subitem) const
+{
+ // Dummy implementation
+ CString s;
+ s.Format(_T("subitem %d"), subitem);
+ return s;
+}
+
+int CSortingListItem::GetImage() const
+{
+ // Dummy implementation
+ return 0;
+}
+
+// Return value:
+// <= -2: this is less than other regardless of ascending flag
+// -1: this is less than other
+// 0: this equals other
+// +1: this is greater than other
+// >= +1: this is greater than other regardless of ascending flag.
+//
+int CSortingListItem::Compare(const CSortingListItem *other, int subitem) const
+{
+ // Default implementation compares strings
+ return signum(GetText(subitem).CompareNoCase(other->GetText(subitem)));
+}
+
+// TODO: check how suitable those are for Unicode-only strings (say Russian)
+int CSortingListItem::CompareS(const CSortingListItem *other, const SSorting& sorting) const
+{
+ int r = Compare(other, sorting.column1);
+ if(abs(r) < 2 && !sorting.ascending1)
+ {
+ r = -r;
+ }
+
+ if(r == 0 && sorting.column2 != sorting.column1)
+ {
+ r = Compare(other, sorting.column2);
+ if(abs(r) < 2 && !sorting.ascending2)
+ {
+ r = -r;
+ }
+ }
+ return r;
+}
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+IMPLEMENT_DYNAMIC(CSortingListControl, CListCtrl)
+
+CSortingListControl::CSortingListControl(LPCTSTR name)
+{
+ m_name = name;
+ m_indicatedColumn = -1;
+}
+
+CSortingListControl::~CSortingListControl()
+{
+}
+
+void CSortingListControl::LoadPersistentAttributes()
+{
+ int i = 0;
+ CArray<int, int> arr;
+ arr.SetSize(GetHeaderCtrl()->GetItemCount());
+
+ GetColumnOrderArray(arr.GetData(), arr.GetSize());
+ CPersistence::GetColumnOrder(m_name, arr);
+ SetColumnOrderArray(int(arr.GetSize()), arr.GetData());
+
+ for(i = 0; i < arr.GetSize(); i++)
+ {
+ arr[i]= GetColumnWidth(i);
+ }
+ CPersistence::GetColumnWidths(m_name, arr);
+ for(i = 0; i < arr.GetSize(); i++)
+ {
+ // To avoid "insane" settings we set the column width to
+ // maximal twice the default width.
+ int maxWidth = GetColumnWidth(i) * 2;
+ int w = min(arr[i], maxWidth);
+ SetColumnWidth(i, w);
+ }
+
+ // Not so good: CPersistence::GetSorting(m_name, GetHeaderCtrl()->GetItemCount(), m_sorting.column1, m_sorting.ascending1, m_sorting.column2, m_sorting.ascending2);
+ // We refrain from saving the sorting because it is too likely, that
+ // users start up with insane settings and don't get it.
+}
+
+void CSortingListControl::SavePersistentAttributes()
+{
+ CArray<int, int> arr;
+ arr.SetSize(GetHeaderCtrl()->GetItemCount());
+
+ GetColumnOrderArray(arr.GetData(), arr.GetSize());
+ CPersistence::SetColumnOrder(m_name, arr);
+
+ for(int i = 0; i < arr.GetSize(); i++)
+ {
+ arr[i]= GetColumnWidth(i);
+ }
+ CPersistence::SetColumnWidths(m_name, arr);
+
+ // Not so good: CPersistence::SetSorting(m_name, m_sorting.column1, m_sorting.ascending1, m_sorting.column2, m_sorting.ascending2);
+}
+
+void CSortingListControl::AddExtendedStyle(DWORD exStyle)
+{
+ SetExtendedStyle(GetExtendedStyle() | exStyle);
+}
+
+void CSortingListControl::RemoveExtendedStyle(DWORD exStyle)
+{
+ SetExtendedStyle(GetExtendedStyle() & ~exStyle);
+}
+
+
+const SSorting& CSortingListControl::GetSorting()
+{
+ return m_sorting;
+}
+
+void CSortingListControl::SetSorting(const SSorting& sorting)
+{
+ m_sorting = sorting;
+}
+
+void CSortingListControl::SetSorting(int sortColumn1, bool ascending1, int sortColumn2, bool ascending2)
+{
+ m_sorting.column1 = sortColumn1;
+ m_sorting.ascending1 = ascending1;
+ m_sorting.column2 = sortColumn2;
+ m_sorting.ascending2 = ascending2;
+}
+
+void CSortingListControl::SetSorting(int sortColumn, bool ascending)
+{
+ m_sorting.column2 = m_sorting.column1;
+ m_sorting.ascending2 = m_sorting.ascending1;
+ m_sorting.column1 = sortColumn;
+ m_sorting.ascending1 = ascending;
+}
+
+void CSortingListControl::InsertListItem(int i, CSortingListItem *item)
+{
+ LVITEM lvitem;
+ ZeroMemory(&lvitem, sizeof(lvitem));
+
+ lvitem.mask = LVIF_TEXT | LVIF_PARAM;
+ if(HasImages())
+ {
+ lvitem.mask |= LVIF_IMAGE;
+ }
+
+ lvitem.iItem = i;
+ lvitem.pszText = LPSTR_TEXTCALLBACK;
+ lvitem.iImage = I_IMAGECALLBACK;
+ lvitem.lParam = (LPARAM)item;
+
+ VERIFY(i == CListCtrl::InsertItem(&lvitem));
+}
+
+CSortingListItem *CSortingListControl::GetSortingListItem(int i)
+{
+ return (CSortingListItem *)GetItemData(i);
+}
+
+void CSortingListControl::SortItems()
+{
+ VERIFY(CListCtrl::SortItems(&_CompareFunc, (DWORD_PTR)&m_sorting));
+
+ HDITEM hditem;
+ ZeroMemory(&hditem, sizeof(hditem));
+
+ if(m_indicatedColumn != -1)
+ {
+ CString text;
+ hditem.mask = HDI_TEXT;
+ hditem.pszText = text.GetBuffer(256);
+ hditem.cchTextMax = 256;
+ GetHeaderCtrl()->GetItem(m_indicatedColumn, &hditem);
+ text.ReleaseBuffer();
+ text = text.Mid(2);
+ hditem.pszText = (LPTSTR)(LPCTSTR)text;
+ GetHeaderCtrl()->SetItem(m_indicatedColumn, &hditem);
+ }
+
+ CString text;
+ hditem.mask = HDI_TEXT;
+ hditem.pszText = text.GetBuffer(256);
+ hditem.cchTextMax = 256;
+ GetHeaderCtrl()->GetItem(m_sorting.column1, &hditem);
+ text.ReleaseBuffer();
+ text = (m_sorting.ascending1 ? _T("< ") : _T("> ")) + text;
+ hditem.pszText = (LPTSTR)(LPCTSTR)text;
+ GetHeaderCtrl()->SetItem(m_sorting.column1, &hditem);
+ m_indicatedColumn = m_sorting.column1;
+}
+
+bool CSortingListControl::GetAscendingDefault(int /*column*/)
+{
+ return true;
+}
+
+bool CSortingListControl::HasImages()
+{
+ return false;
+}
+
+# if (_MFC_VER <=0x0800)
+BOOL CSortingListControl::GetColumnOrderArray(LPINT piArray, INT_PTR iCount)
+{
+ ASSERT(iCount <= INT_MAX);
+ return dynamic_cast<CListCtrl*>(this)->GetColumnOrderArray(piArray, (int)iCount);
+}
+# endif
+
+int CALLBACK CSortingListControl::_CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
+{
+ CSortingListItem *item1 = (CSortingListItem *)lParam1;
+ CSortingListItem *item2 = (CSortingListItem *)lParam2;
+ SSorting *sorting = (SSorting *)lParamSort;
+
+ return item1->CompareS(item2, *sorting);
+}
+
+BEGIN_MESSAGE_MAP(CSortingListControl, CListCtrl)
+ ON_NOTIFY_REFLECT(LVN_GETDISPINFO, OnLvnGetdispinfo)
+ ON_NOTIFY(HDN_ITEMCLICKA, 0, OnHdnItemclick)
+ ON_NOTIFY(HDN_ITEMCLICKW, 0, OnHdnItemclick)
+ ON_NOTIFY(HDN_ITEMDBLCLICKA, 0, OnHdnItemdblclick)
+ ON_NOTIFY(HDN_ITEMDBLCLICKW, 0, OnHdnItemdblclick)
+ ON_WM_DESTROY()
+END_MESSAGE_MAP()
+
+void CSortingListControl::OnLvnGetdispinfo(NMHDR *pNMHDR, LRESULT *pResult)
+{
+ NMLVDISPINFO *di = reinterpret_cast<NMLVDISPINFO*>(pNMHDR);
+ *pResult = 0;
+
+ CSortingListItem *item = (CSortingListItem *)(di->item.lParam);
+
+ if((di->item.mask & LVIF_TEXT) != 0)
+ {
+ _tcscpy_s(di->item.pszText, di->item.cchTextMax, item->GetText(di->item.iSubItem));
+ }
+
+ if((di->item.mask & LVIF_IMAGE) != 0)
+ {
+ di->item.iImage = item->GetImage();
+ }
+}
+
+void CSortingListControl::OnHdnItemclick(NMHDR *pNMHDR, LRESULT *pResult)
+{
+ LPNMHEADER phdr = reinterpret_cast<LPNMHEADER>(pNMHDR);
+ *pResult = 0;
+ const int col = phdr->iItem;
+
+ if(col == m_sorting.column1)
+ {
+ m_sorting.ascending1 = !m_sorting.ascending1;
+ }
+ else
+ {
+ SetSorting(col, GetAscendingDefault(col));
+ }
+
+ SortItems();
+}
+
+
+void CSortingListControl::OnHdnItemdblclick(NMHDR *pNMHDR, LRESULT *pResult)
+{
+ OnHdnItemclick(pNMHDR, pResult);
+}
+
+void CSortingListControl::OnDestroy()
+{
+ SavePersistentAttributes();
+ CListCtrl::OnDestroy();
+}
diff --git a/windirstat/Controls/sortinglistcontrol.h b/windirstat/Controls/sortinglistcontrol.h
index 8f0acde..3a2c82f 100644
--- a/windirstat/Controls/sortinglistcontrol.h
+++ b/windirstat/Controls/sortinglistcontrol.h
@@ -1,111 +1,111 @@
-// sortinglistcontrol.h - Declaration of CSortingListItem and CSortingListControl
-//
-// WinDirStat - Directory Statistics
-// Copyright (C) 2003-2005 Bernhard Seifert
-// Copyright (C) 2004-2016 WinDirStat team (windirstat.info)
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-//
-
-#ifndef __WDS_SORTINGLISTCONTROL_H__
-#define __WDS_SORTINGLISTCONTROL_H__
-#pragma once
-
-//
-// SSorting. A sorting specification. We sort by column1, and if two items
-// equal in column1, we sort them by column2.
-//
-struct SSorting
-{
- SSorting() { column1 = column2 = 0; ascending1 = ascending2 = true; }
- int column1;
- bool ascending1;
- int column2;
- bool ascending2;
-};
-
-//
-// CSortingListItem. An item in a CSortingListControl.
-//
-class CSortingListItem
-{
-public:
- virtual CString GetText(int subitem) const;
- virtual int GetImage() const;
- virtual int Compare(const CSortingListItem *other, int subitem) const;
- int CompareS(const CSortingListItem *other, const SSorting& sorting) const;
-};
-
-
-//
-// CSortingListControl. The base class for all our ListControls.
-// The lParams of the items are pointers to CSortingListItems.
-// The items use LPSTR_TEXTCALLBACK and I_IMAGECALLBACK.
-// And the items can compare to one another.
-// CSortingListControl maintains a SSorting and handles clicks
-// on the header items. It also indicates the sorting to the user
-// by adding a "<" or ">" to the header items.
-//
-class CSortingListControl: public CListCtrl
-{
- DECLARE_DYNAMIC(CSortingListControl)
-public:
- // Construction
- CSortingListControl(LPCTSTR name);
- virtual ~CSortingListControl();
-
- // Public methods
- void LoadPersistentAttributes();
-
- void AddExtendedStyle(DWORD exStyle);
- void RemoveExtendedStyle(DWORD exStyle);
-
- const SSorting& GetSorting();
- void GetSorting(int& sortColumn1, bool& ascending1, int& sortColumn2, bool& ascending2);
-
- void SetSorting(const SSorting& sorting);
- void SetSorting(int sortColumn1, bool ascending1, int sortColumn2, bool ascending2);
- void SetSorting(int sortColumn, bool ascending);
-
- void InsertListItem(int i, CSortingListItem *item);
- CSortingListItem *GetSortingListItem(int i);
-
- // Overridables
- virtual void SortItems();
- virtual bool GetAscendingDefault(int column);
- virtual bool HasImages();
-
-# if (_MFC_VER <=0x0800)
- BOOL GetColumnOrderArray(LPINT piArray, INT_PTR iCount = -1);
-# endif
-
-private:
- void SavePersistentAttributes();
- static int CALLBACK _CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
-
- CString m_name; // for persistence
- SSorting m_sorting;
-
- int m_indicatedColumn;
-
- DECLARE_MESSAGE_MAP()
- afx_msg void OnLvnGetdispinfo(NMHDR *pNMHDR, LRESULT *pResult);
- afx_msg void OnHdnItemclick(NMHDR *pNMHDR, LRESULT *pResult);
- afx_msg void OnHdnItemdblclick(NMHDR *pNMHDR, LRESULT *pResult);
- afx_msg void OnDestroy();
-};
-
-#endif // __WDS_SORTINGLISTCONTROL_H__
+// sortinglistcontrol.h - Declaration of CSortingListItem and CSortingListControl
+//
+// WinDirStat - Directory Statistics
+// Copyright (C) 2003-2005 Bernhard Seifert
+// Copyright (C) 2004-2016 WinDirStat team (windirstat.info)
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+//
+
+#ifndef __WDS_SORTINGLISTCONTROL_H__
+#define __WDS_SORTINGLISTCONTROL_H__
+#pragma once
+
+//
+// SSorting. A sorting specification. We sort by column1, and if two items
+// equal in column1, we sort them by column2.
+//
+struct SSorting
+{
+ SSorting() { column1 = column2 = 0; ascending1 = ascending2 = true; }
+ int column1;
+ bool ascending1;
+ int column2;
+ bool ascending2;
+};
+
+//
+// CSortingListItem. An item in a CSortingListControl.
+//
+class CSortingListItem
+{
+public:
+ virtual CString GetText(int subitem) const;
+ virtual int GetImage() const;
+ virtual int Compare(const CSortingListItem *other, int subitem) const;
+ int CompareS(const CSortingListItem *other, const SSorting& sorting) const;
+};
+
+
+//
+// CSortingListControl. The base class for all our ListControls.
+// The lParams of the items are pointers to CSortingListItems.
+// The items use LPSTR_TEXTCALLBACK and I_IMAGECALLBACK.
+// And the items can compare to one another.
+// CSortingListControl maintains a SSorting and handles clicks
+// on the header items. It also indicates the sorting to the user
+// by adding a "<" or ">" to the header items.
+//
+class CSortingListControl: public CListCtrl
+{
+ DECLARE_DYNAMIC(CSortingListControl)
+public:
+ // Construction
+ CSortingListControl(LPCTSTR name);
+ virtual ~CSortingListControl();
+
+ // Public methods
+ void LoadPersistentAttributes();
+
+ void AddExtendedStyle(DWORD exStyle);
+ void RemoveExtendedStyle(DWORD exStyle);
+
+ const SSorting& GetSorting();
+ void GetSorting(int& sortColumn1, bool& ascending1, int& sortColumn2, bool& ascending2);
+
+ void SetSorting(const SSorting& sorting);
+ void SetSorting(int sortColumn1, bool ascending1, int sortColumn2, bool ascending2);
+ void SetSorting(int sortColumn, bool ascending);
+
+ void InsertListItem(int i, CSortingListItem *item);
+ CSortingListItem *GetSortingListItem(int i);
+
+ // Overridables
+ virtual void SortItems();
+ virtual bool GetAscendingDefault(int column);
+ virtual bool HasImages();
+
+# if (_MFC_VER <=0x0800)
+ BOOL GetColumnOrderArray(LPINT piArray, INT_PTR iCount = -1);
+# endif
+
+private:
+ void SavePersistentAttributes();
+ static int CALLBACK _CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
+
+ CString m_name; // for persistence
+ SSorting m_sorting;
+
+ int m_indicatedColumn;
+
+ DECLARE_MESSAGE_MAP()
+ afx_msg void OnLvnGetdispinfo(NMHDR *pNMHDR, LRESULT *pResult);
+ afx_msg void OnHdnItemclick(NMHDR *pNMHDR, LRESULT *pResult);
+ afx_msg void OnHdnItemdblclick(NMHDR *pNMHDR, LRESULT *pResult);
+ afx_msg void OnDestroy();
+};
+
+#endif // __WDS_SORTINGLISTCONTROL_H__
diff --git a/windirstat/Controls/treemap.cpp b/windirstat/Controls/treemap.cpp
index 8cfce56..0264f5d 100644
--- a/windirstat/Controls/treemap.cpp
+++ b/windirstat/Controls/treemap.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "treemap.h"
diff --git a/windirstat/Controls/treemap.h b/windirstat/Controls/treemap.h
index 28bbf3c..99cfe48 100644
--- a/windirstat/Controls/treemap.h
+++ b/windirstat/Controls/treemap.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_TREEMAP_H__
#define __WDS_TREEMAP_H__
diff --git a/windirstat/Controls/typeview.cpp b/windirstat/Controls/typeview.cpp
index e49c359..6618dd4 100644
--- a/windirstat/Controls/typeview.cpp
+++ b/windirstat/Controls/typeview.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/Controls/typeview.h b/windirstat/Controls/typeview.h
index 3ed260d..a1c215a 100644
--- a/windirstat/Controls/typeview.h
+++ b/windirstat/Controls/typeview.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_TYPEVIEW_H__
#define __WDS_TYPEVIEW_H__
diff --git a/windirstat/Controls/xyslider.cpp b/windirstat/Controls/xyslider.cpp
index 5cc4793..ac405eb 100644
--- a/windirstat/Controls/xyslider.cpp
+++ b/windirstat/Controls/xyslider.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "xyslider.h"
diff --git a/windirstat/Controls/xyslider.h b/windirstat/Controls/xyslider.h
index 8fd9247..c048852 100644
--- a/windirstat/Controls/xyslider.h
+++ b/windirstat/Controls/xyslider.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_XYSLIDER_H__
#define __WDS_XYSLIDER_H__
diff --git a/windirstat/Dialogs/AboutDlg.h b/windirstat/Dialogs/AboutDlg.h
index ef37721..0b59154 100644
--- a/windirstat/Dialogs/AboutDlg.h
+++ b/windirstat/Dialogs/AboutDlg.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_ABOUTDLG_H__
#define __WDS_ABOUTDLG_H__
diff --git a/windirstat/Dialogs/DeleteWarningDlg.cpp b/windirstat/Dialogs/DeleteWarningDlg.cpp
index dc2f997..a8b8dd8 100644
--- a/windirstat/Dialogs/DeleteWarningDlg.cpp
+++ b/windirstat/Dialogs/DeleteWarningDlg.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/Dialogs/DeleteWarningDlg.h b/windirstat/Dialogs/DeleteWarningDlg.h
index c222d84..261b1f7 100644
--- a/windirstat/Dialogs/DeleteWarningDlg.h
+++ b/windirstat/Dialogs/DeleteWarningDlg.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#pragma once
diff --git a/windirstat/Dialogs/SelectDrivesDlg.cpp b/windirstat/Dialogs/SelectDrivesDlg.cpp
index c3f66f5..1620dfb 100644
--- a/windirstat/Dialogs/SelectDrivesDlg.cpp
+++ b/windirstat/Dialogs/SelectDrivesDlg.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/Dialogs/SelectDrivesDlg.h b/windirstat/Dialogs/SelectDrivesDlg.h
index fe881dd..c0911a0 100644
--- a/windirstat/Dialogs/SelectDrivesDlg.h
+++ b/windirstat/Dialogs/SelectDrivesDlg.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_SELECTDRIVESDLG_H__
#define __WDS_SELECTDRIVESDLG_H__
diff --git a/windirstat/Dialogs/aboutdlg.cpp b/windirstat/Dialogs/aboutdlg.cpp
index f7dd963..1d1f39d 100644
--- a/windirstat/Dialogs/aboutdlg.cpp
+++ b/windirstat/Dialogs/aboutdlg.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/FileFindWDS.cpp b/windirstat/FileFindWDS.cpp
index 82ec9cf..4d29bb7 100644
--- a/windirstat/FileFindWDS.cpp
+++ b/windirstat/FileFindWDS.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "StdAfx.h"
#include "FileFindWDS.h"
diff --git a/windirstat/FileFindWDS.h b/windirstat/FileFindWDS.h
index 40c457e..1405588 100644
--- a/windirstat/FileFindWDS.h
+++ b/windirstat/FileFindWDS.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_FILEFINDWDS_H__
#define __WDS_FILEFINDWDS_H__
diff --git a/windirstat/ModalApiShuttle.cpp b/windirstat/ModalApiShuttle.cpp
index 3cf1edd..da8f50f 100644
--- a/windirstat/ModalApiShuttle.cpp
+++ b/windirstat/ModalApiShuttle.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/ModalApiShuttle.h b/windirstat/ModalApiShuttle.h
index a488997..f970127 100644
--- a/windirstat/ModalApiShuttle.h
+++ b/windirstat/ModalApiShuttle.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_MODALAPISHUTTLE_H__
#define __WDS_MODALAPISHUTTLE_H__
diff --git a/windirstat/ModalShellApi.cpp b/windirstat/ModalShellApi.cpp
index 5d1c65a..fd752ad 100644
--- a/windirstat/ModalShellApi.cpp
+++ b/windirstat/ModalShellApi.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/ModalShellApi.h b/windirstat/ModalShellApi.h
index 0bd2434..c6c0122 100644
--- a/windirstat/ModalShellApi.h
+++ b/windirstat/ModalShellApi.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_MODALSHELLAPI_H__
#define __WDS_MODALSHELLAPI_H__
diff --git a/windirstat/PageCleanups.cpp b/windirstat/PageCleanups.cpp
index 845ec53..838d1e6 100644
--- a/windirstat/PageCleanups.cpp
+++ b/windirstat/PageCleanups.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/PageCleanups.h b/windirstat/PageCleanups.h
index 30c58de..d0e2121 100644
--- a/windirstat/PageCleanups.h
+++ b/windirstat/PageCleanups.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_PAGECLEANUPS_H__
#define __WDS_PAGECLEANUPS_H__
diff --git a/windirstat/PageGeneral.cpp b/windirstat/PageGeneral.cpp
index 1d34168..4fd72a4 100644
--- a/windirstat/PageGeneral.cpp
+++ b/windirstat/PageGeneral.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/PageGeneral.h b/windirstat/PageGeneral.h
index 458afc5..e451f2c 100644
--- a/windirstat/PageGeneral.h
+++ b/windirstat/PageGeneral.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_PAGEGENERAL_H__
#define __WDS_PAGEGENERAL_H__
diff --git a/windirstat/PageTreelist.cpp b/windirstat/PageTreelist.cpp
index 2266f7c..8bdfef8 100644
--- a/windirstat/PageTreelist.cpp
+++ b/windirstat/PageTreelist.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/PageTreelist.h b/windirstat/PageTreelist.h
index 9aff869..c490e1d 100644
--- a/windirstat/PageTreelist.h
+++ b/windirstat/PageTreelist.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_PAGETREELIST_H__
#define __WDS_PAGETREELIST_H__
diff --git a/windirstat/PageTreemap.cpp b/windirstat/PageTreemap.cpp
index d74301d..d2034fe 100644
--- a/windirstat/PageTreemap.cpp
+++ b/windirstat/PageTreemap.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/PageTreemap.h b/windirstat/PageTreemap.h
index 0c9d7cb..cfeb4de 100644
--- a/windirstat/PageTreemap.h
+++ b/windirstat/PageTreemap.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_PAGETREEMAP_H__
#define __WDS_PAGETREEMAP_H__
diff --git a/windirstat/WDS_Lua_C.c b/windirstat/WDS_Lua_C.c
index da6b78f..7d12dc7 100644
--- a/windirstat/WDS_Lua_C.c
+++ b/windirstat/WDS_Lua_C.c
@@ -1,61 +1,61 @@
-#define luaall_c
-#define LUA_CORE
-#include "WDS_Lua_C.h"
-
-#ifdef _WIN64
-# pragma warning(push)
-# pragma warning(disable:4324)
-# pragma warning(disable:4334)
-#endif
-
-// Modules/Packages, individual functions
-#include "modules/winreg.c"
-#include "modules/isadmin.c"
-#include "modules/wow64.c"
-#include "modules/dbgprint.c"
-#include "modules/w32resembed.c"
-
-// Cheat a bit to redefine the list of "default" libraries ...
-#ifndef WDS_LUA_NO_INIT
-static const luaL_Reg lualibs[] = {
- {"", luaopen_base},
- {LUA_LOADLIBNAME, luaopen_package},
- {LUA_TABLIBNAME, luaopen_table},
- {LUA_IOLIBNAME, luaopen_io},
- {LUA_OSLIBNAME, luaopen_os},
- {LUA_STRLIBNAME, luaopen_string},
- {LUA_MATHLIBNAME, luaopen_math},
- {LUA_DBLIBNAME, luaopen_debug},
- {LUA_WINREGNAME, luaopen_winreg},
- {NULL, NULL},
-};
-
-static void luaWDS_openlibs_(lua_State *L)
-{
- const luaL_Reg *lib = lualibs;
- for (; lib->func; lib++) {
- lua_pushcfunction(L, lib->func);
- lua_pushstring(L, lib->name);
- lua_call(L, 1, 0);
- }
-}
-#endif // WDS_LUA_NO_INIT // otherwise the implementer needs to define her own version ;)
-
-lua_State* luaWDS_open()
-{
- lua_State* L = lua_open();
- if(L)
- {
- lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */
- luaWDS_openlibs_(L); /* open libraries */
- luaL_register(L, LUA_OSLIBNAME, wow64_funcs);
- luaL_register(L, LUA_OSLIBNAME, isadmin_funcs);
- luaL_register(L, LUA_OSLIBNAME, dbgprint_funcs);
- lua_gc(L, LUA_GCRESTART, 0); /* resume GC */
- }
- return L;
-}
-
-#ifdef _WIN64
-# pragma warning(pop)
-#endif
+#define luaall_c
+#define LUA_CORE
+#include "WDS_Lua_C.h"
+
+#ifdef _WIN64
+# pragma warning(push)
+# pragma warning(disable:4324)
+# pragma warning(disable:4334)
+#endif
+
+// Modules/Packages, individual functions
+#include "modules/winreg.c"
+#include "modules/isadmin.c"
+#include "modules/wow64.c"
+#include "modules/dbgprint.c"
+#include "modules/w32resembed.c"
+
+// Cheat a bit to redefine the list of "default" libraries ...
+#ifndef WDS_LUA_NO_INIT
+static const luaL_Reg lualibs[] = {
+ {"", luaopen_base},
+ {LUA_LOADLIBNAME, luaopen_package},
+ {LUA_TABLIBNAME, luaopen_table},
+ {LUA_IOLIBNAME, luaopen_io},
+ {LUA_OSLIBNAME, luaopen_os},
+ {LUA_STRLIBNAME, luaopen_string},
+ {LUA_MATHLIBNAME, luaopen_math},
+ {LUA_DBLIBNAME, luaopen_debug},
+ {LUA_WINREGNAME, luaopen_winreg},
+ {NULL, NULL},
+};
+
+static void luaWDS_openlibs_(lua_State *L)
+{
+ const luaL_Reg *lib = lualibs;
+ for (; lib->func; lib++) {
+ lua_pushcfunction(L, lib->func);
+ lua_pushstring(L, lib->name);
+ lua_call(L, 1, 0);
+ }
+}
+#endif // WDS_LUA_NO_INIT // otherwise the implementer needs to define her own version ;)
+
+lua_State* luaWDS_open()
+{
+ lua_State* L = lua_open();
+ if(L)
+ {
+ lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */
+ luaWDS_openlibs_(L); /* open libraries */
+ luaL_register(L, LUA_OSLIBNAME, wow64_funcs);
+ luaL_register(L, LUA_OSLIBNAME, isadmin_funcs);
+ luaL_register(L, LUA_OSLIBNAME, dbgprint_funcs);
+ lua_gc(L, LUA_GCRESTART, 0); /* resume GC */
+ }
+ return L;
+}
+
+#ifdef _WIN64
+# pragma warning(pop)
+#endif
diff --git a/windirstat/WDS_Lua_C.h b/windirstat/WDS_Lua_C.h
index e606875..7908885 100644
--- a/windirstat/WDS_Lua_C.h
+++ b/windirstat/WDS_Lua_C.h
@@ -1,40 +1,40 @@
-#ifndef __WDS_LUA_C_H_VER__
-#define __WDS_LUA_C_H_VER__ 2012121805
-#if (defined(_MSC_VER) && (_MSC_VER >= 1020)) || defined(__MCPP)
-#pragma once
-#endif // Check for "#pragma once" support
-
-#define LNUM_INT64
-#define WDS_LUA_NO_LUAC
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif // __cplusplus
-# include <lua.h>
-# include <lauxlib.h>
-# include <lualib.h>
- lua_State* luaWDS_open();
-#ifdef __cplusplus
-};
-#endif // __cplusplus
-
-// Modules/Packages headers
-#include "modules/winreg.h"
-#include "modules/lua-winreg/src/lua_tstring.h"
-#include "modules/isadmin.h"
-#include "modules/wow64.h"
-#include "modules/dbgprint.h"
-#include "modules/w32resembed.h"
-
-#ifndef lua_pushtstring_lowercase
- // same as in Lua: s = s:lower() ... with s on the stack afterward
-# define lua_pushtstring_lowercase(L, s) \
- lua_getfield(L, LUA_GLOBALSINDEX, "string"); \
- lua_getfield(L, -1, "lower"); \
- lua_remove(L, -2); \
- lua_pushtstring(L, s); \
- lua_call(L, 1, 1)
-#endif // lua_pushtstring_lowercase
-
-#endif // __WDS_LUA_C_H_VER__
+#ifndef __WDS_LUA_C_H_VER__
+#define __WDS_LUA_C_H_VER__ 2012121805
+#if (defined(_MSC_VER) && (_MSC_VER >= 1020)) || defined(__MCPP)
+#pragma once
+#endif // Check for "#pragma once" support
+
+#define LNUM_INT64
+#define WDS_LUA_NO_LUAC
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif // __cplusplus
+# include <lua.h>
+# include <lauxlib.h>
+# include <lualib.h>
+ lua_State* luaWDS_open();
+#ifdef __cplusplus
+};
+#endif // __cplusplus
+
+// Modules/Packages headers
+#include "modules/winreg.h"
+#include "modules/lua-winreg/src/lua_tstring.h"
+#include "modules/isadmin.h"
+#include "modules/wow64.h"
+#include "modules/dbgprint.h"
+#include "modules/w32resembed.h"
+
+#ifndef lua_pushtstring_lowercase
+ // same as in Lua: s = s:lower() ... with s on the stack afterward
+# define lua_pushtstring_lowercase(L, s) \
+ lua_getfield(L, LUA_GLOBALSINDEX, "string"); \
+ lua_getfield(L, -1, "lower"); \
+ lua_remove(L, -2); \
+ lua_pushtstring(L, s); \
+ lua_call(L, 1, 1)
+#endif // lua_pushtstring_lowercase
+
+#endif // __WDS_LUA_C_H_VER__
diff --git a/windirstat/WorkLimiter.cpp b/windirstat/WorkLimiter.cpp
index 038e21e..398dc79 100644
--- a/windirstat/WorkLimiter.cpp
+++ b/windirstat/WorkLimiter.cpp
@@ -1,60 +1,60 @@
-#include "stdafx.h"
-#include "WorkLimiter.h"
-
-CWorkLimiter::CWorkLimiter()
- : m_done()
- , m_tickLimit()
- , m_prevTicks()
-{
-}
-
-CWorkLimiter::~CWorkLimiter()
-{
-}
-
-void CWorkLimiter::Start(DWORD ticks)
-{
- DWORD start = Now();
- m_done = false;
- m_tickLimit = start + ticks;
- m_prevTicks = start;
-}
-
-bool CWorkLimiter::IsDone() const
-{
- if (m_done) return true;
-
- // check remaining ticks
- DWORD now = Now();
- // signed subtraction to deal with overflow
- long remaining = m_tickLimit - now;
- if (remaining <= 0)
- {
- m_done = true;
- return true;
- }
-
- // check if there are any pending window messages
- long elapsed = now - m_prevTicks;
- if (elapsed > 10)
- {
- m_prevTicks = now;
- MSG msg;
- if (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE | PM_QS_INPUT))
- {
- m_done = true;
- return true;
- }
- }
-
- return false;
-}
-
-void CWorkLimiter::DoFileWork()
-{
-}
-
-DWORD CWorkLimiter::Now() const
-{
- return ::GetTickCount();
-} \ No newline at end of file
+#include "stdafx.h"
+#include "WorkLimiter.h"
+
+CWorkLimiter::CWorkLimiter()
+ : m_done()
+ , m_tickLimit()
+ , m_prevTicks()
+{
+}
+
+CWorkLimiter::~CWorkLimiter()
+{
+}
+
+void CWorkLimiter::Start(DWORD ticks)
+{
+ DWORD start = Now();
+ m_done = false;
+ m_tickLimit = start + ticks;
+ m_prevTicks = start;
+}
+
+bool CWorkLimiter::IsDone() const
+{
+ if (m_done) return true;
+
+ // check remaining ticks
+ DWORD now = Now();
+ // signed subtraction to deal with overflow
+ long remaining = m_tickLimit - now;
+ if (remaining <= 0)
+ {
+ m_done = true;
+ return true;
+ }
+
+ // check if there are any pending window messages
+ long elapsed = now - m_prevTicks;
+ if (elapsed > 10)
+ {
+ m_prevTicks = now;
+ MSG msg;
+ if (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE | PM_QS_INPUT))
+ {
+ m_done = true;
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void CWorkLimiter::DoFileWork()
+{
+}
+
+DWORD CWorkLimiter::Now() const
+{
+ return ::GetTickCount();
+}
diff --git a/windirstat/WorkLimiter.h b/windirstat/WorkLimiter.h
index ffda715..c494599 100644
--- a/windirstat/WorkLimiter.h
+++ b/windirstat/WorkLimiter.h
@@ -17,30 +17,30 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_WORKLIMITER_H__
#define __WDS_WORKLIMITER_H__
-#pragma once
-
-#include <WinDef.h>
-
-class CWorkLimiter
-{
-public:
- CWorkLimiter();
- ~CWorkLimiter();
-
- void Start(DWORD ticks);
- bool IsDone() const;
- void DoFileWork();
-
-private:
- DWORD Now() const;
-
-private:
- mutable bool m_done;
- DWORD m_tickLimit;
- mutable DWORD m_prevTicks;
-};
-
+#pragma once
+
+#include <WinDef.h>
+
+class CWorkLimiter
+{
+public:
+ CWorkLimiter();
+ ~CWorkLimiter();
+
+ void Start(DWORD ticks);
+ bool IsDone() const;
+ void DoFileWork();
+
+private:
+ DWORD Now() const;
+
+private:
+ mutable bool m_done;
+ DWORD m_tickLimit;
+ mutable DWORD m_prevTicks;
+};
+
#endif \ No newline at end of file
diff --git a/windirstat/dirstatdoc.cpp b/windirstat/dirstatdoc.cpp
index d116f82..1772d03 100644
--- a/windirstat/dirstatdoc.cpp
+++ b/windirstat/dirstatdoc.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/dirstatdoc.h b/windirstat/dirstatdoc.h
index 6924996..b849980 100644
--- a/windirstat/dirstatdoc.h
+++ b/windirstat/dirstatdoc.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_DIRSTATDOC_H__
#define __WDS_DIRSTATDOC_H__
diff --git a/windirstat/dirstatview.cpp b/windirstat/dirstatview.cpp
index 624364a..e8f7d37 100644
--- a/windirstat/dirstatview.cpp
+++ b/windirstat/dirstatview.cpp
@@ -1,451 +1,451 @@
-// dirstatview.cpp - Implementation of CDirstatView
-//
-// WinDirStat - Directory Statistics
-// Copyright (C) 2003-2005 Bernhard Seifert
-// Copyright (C) 2004-2016 WinDirStat team (windirstat.info)
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-//
-
-#include "stdafx.h"
-#include "windirstat.h"
-#include "dirstatdoc.h"
-#include "item.h"
-#include "mainframe.h"
-#include "dirstatview.h"
-#include "osspecific.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#endif
-
-namespace
-{
- const UINT _nIdTreeListControl = 4711;
-}
-
-CMyTreeListControl::CMyTreeListControl(CDirstatView *dirstatView)
- : CTreeListControl(dirstatView, 20)
-{
-}
-
-bool CMyTreeListControl::GetAscendingDefault(int column)
-{
- return (column == COL_NAME || column == COL_LASTCHANGE);
-}
-
-BEGIN_MESSAGE_MAP(CMyTreeListControl, CTreeListControl)
- ON_WM_CONTEXTMENU()
- ON_WM_SETFOCUS()
- ON_WM_KEYDOWN()
-END_MESSAGE_MAP()
-
-
-void CMyTreeListControl::OnContextMenu(CWnd* /*pWnd*/, CPoint pt)
-{
- int i = GetSelectedItem();
- if(i == -1)
- {
- return;
- }
-
- CTreeListItem *item = GetItem(i);
-
- CRect rc = GetWholeSubitemRect(i, 0);
- CRect rcTitle = item->GetTitleRect() + rc.TopLeft();
-
- CMenu menu;
- menu.LoadMenu(IDR_POPUPLIST);
- CMenu *sub = menu.GetSubMenu(0);
-
- PrepareDefaultMenu(sub, (CItem *)item);
- GetMainFrame()->AppendUserDefinedCleanups(sub);
-
- // Show popup menu and act accordingly.
- //
- // The menu shall not overlap the label but appear
- // horizontally at the cursor position,
- // vertically under (or above) the label.
- // TrackPopupMenuEx() behaves in the desired way, if
- // we exclude the label rectangle extended to full screen width.
- //
- // Thanks to Sven for this compromise between the old WinDirStat
- // behavior (show the menu to the right of the label) and the
- // Explorer behavior (show the menu at the cursor position).
-
- TPMPARAMS tp;
- tp.cbSize = sizeof(tp);
- tp.rcExclude = rcTitle;
- ClientToScreen(&tp.rcExclude);
-
- CRect desktop;
- GetDesktopWindow()->GetWindowRect(desktop);
-
- tp.rcExclude.left = desktop.left;
- tp.rcExclude.right = desktop.right;
-
- const int overlap = 2; // a little vertical overlapping
- tp.rcExclude.top += overlap;
- tp.rcExclude.bottom -= overlap;
-
- sub->TrackPopupMenuEx(TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, AfxGetMainWnd(), &tp);
-}
-
-void CMyTreeListControl::OnItemDoubleClick(int i)
-{
- const CItem *item = (const CItem *)GetItem(i);
- if(item->GetType() == IT_FILE)
- {
- GetDocument()->OpenItem(item);
- }
- else
- {
- CTreeListControl::OnItemDoubleClick(i);
- }
-}
-
-void CMyTreeListControl::PrepareDefaultMenu(CMenu *menu, const CItem *item)
-{
- if(IsLeaf(item->GetType()))
- {
- menu->DeleteMenu(0, MF_BYPOSITION); // Remove "Expand/Collapse" item
- menu->DeleteMenu(0, MF_BYPOSITION); // Remove separator
- menu->SetDefaultItem(ID_CLEANUP_OPEN, false);
- }
- else
- {
- CString command = LoadString(item->IsExpanded() && item->HasChildren() ? IDS_COLLAPSE : IDS_EXPAND);
- VERIFY(menu->ModifyMenu(ID_POPUP_TOGGLE, MF_BYCOMMAND | MF_STRING, ID_POPUP_TOGGLE, command));
- menu->SetDefaultItem(ID_POPUP_TOGGLE, false);
- }
-}
-
-void CMyTreeListControl::OnSetFocus(CWnd* pOldWnd)
-{
- CTreeListControl::OnSetFocus(pOldWnd);
- GetMainFrame()->SetLogicalFocus(LF_DIRECTORYLIST);
-}
-
-void CMyTreeListControl::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
-{
- if(nChar == VK_TAB)
- {
- GetMainFrame()->MoveFocus(LF_EXTENSIONLIST);
- }
- else if(nChar == VK_ESCAPE)
- {
- GetMainFrame()->MoveFocus(LF_NONE);
- }
- CTreeListControl::OnKeyDown(nChar, nRepCnt, nFlags);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-IMPLEMENT_DYNCREATE(CDirstatView, CView)
-
-CDirstatView::CDirstatView()
- : m_treeListControl(this)
-{
- m_treeListControl.SetSorting(COL_SUBTREETOTAL, false);
-}
-
-CDirstatView::~CDirstatView()
-{
-}
-
-CString CDirstatView::GenerateReport()
-{
- CString report = GetOptions()->GetReportPrefix() + _T("\r\n");
-
- for(size_t j = 0; j < GetDocument()->GetSelectionCount(); j++)
- {
- CItem *root = GetDocument()->GetSelection(j);
- ASSERT(root != NULL);
- ASSERT(root->IsVisible());
-
- int r = m_treeListControl.FindTreeItem(root);
-
- for(
- int i = r;
- i < m_treeListControl.GetItemCount()
- && (i == r || m_treeListControl.GetItem(i)->GetIndent() > root->GetIndent());
- i++
- )
- {
- CItem *item = (CItem *)m_treeListControl.GetItem(i);
-
- if(item->GetType() == IT_MYCOMPUTER)
- {
- continue;
- }
-
- report.AppendFormat(_T("%s %s\r\n"), PadWidthBlanks(FormatLongLongHuman(item->GetSize()), 11), item->GetReportPath());
- }
- }
- report += _T("\r\n\r\n");
- report += GetOptions()->GetReportSuffix();
-
- return report;
-}
-
-// Just a shortcut for CMainFrame to obtain
-// the small font for the suspend button.
-CFont *CDirstatView::GetSmallFont()
-{
- return m_treeListControl.GetFont();
-}
-
-void CDirstatView::SysColorChanged()
-{
- m_treeListControl.SysColorChanged();
-}
-
-BOOL CDirstatView::PreCreateWindow(CREATESTRUCT& cs)
-{
- return CView::PreCreateWindow(cs);
-}
-
-void CDirstatView::OnInitialUpdate()
-{
- CView::OnInitialUpdate();
-}
-void CDirstatView::OnDraw(CDC* pDC)
-{
- CView::OnDraw(pDC);
-}
-
-#ifdef _DEBUG
-CDirstatDoc* CDirstatView::GetDocument() const // Non debug version is inline
-{
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDirstatDoc)));
- return (CDirstatDoc*)m_pDocument;
-}
-#endif
-
-BEGIN_MESSAGE_MAP(CDirstatView, CView)
- ON_WM_SIZE()
- ON_WM_CREATE()
- ON_WM_ERASEBKGND()
- ON_WM_DESTROY()
- ON_WM_SETFOCUS()
- ON_WM_SETTINGCHANGE()
- ON_NOTIFY(LVN_ITEMCHANGED, _nIdTreeListControl, OnLvnItemchanged)
- ON_UPDATE_COMMAND_UI(ID_POPUP_TOGGLE, OnUpdatePopupToggle)
- ON_COMMAND(ID_POPUP_TOGGLE, OnPopupToggle)
-END_MESSAGE_MAP()
-
-void CDirstatView::OnSize(UINT nType, int cx, int cy)
-{
- CView::OnSize(nType, cx, cy);
- if(::IsWindow(m_treeListControl.m_hWnd))
- {
- CRect rc(0, 0, cx, cy);
- m_treeListControl.MoveWindow(rc);
- }
-}
-
-int CDirstatView::OnCreate(LPCREATESTRUCT lpCreateStruct)
-{
- if(CView::OnCreate(lpCreateStruct) == -1)
- {
- return -1;
- }
-
- RECT rect = { 0, 0, 0, 0 };
- VERIFY(m_treeListControl.CreateEx(LVS_EX_HEADERDRAGDROP, WS_CHILD | WS_VISIBLE | LVS_REPORT | LVS_SHOWSELALWAYS, rect, this, _nIdTreeListControl));
-
- m_treeListControl.ShowGrid(GetOptions()->IsListGrid());
- m_treeListControl.ShowStripes(GetOptions()->IsListStripes());
- m_treeListControl.ShowFullRowSelection(GetOptions()->IsListFullRowSelection());
-
- m_treeListControl.InsertColumn(COL_NAME, LoadString(IDS_TREECOL_NAME), LVCFMT_LEFT, 200, COL_NAME);
- m_treeListControl.InsertColumn(COL_SUBTREEPERCENTAGE, LoadString(IDS_TREECOL_SUBTREEPERCENTAGE), LVCFMT_RIGHT, CItem::GetSubtreePercentageWidth(), COL_SUBTREEPERCENTAGE);
- m_treeListControl.InsertColumn(COL_PERCENTAGE, LoadString(IDS_TREECOL_PERCENTAGE), LVCFMT_RIGHT, 55, COL_PERCENTAGE);
- m_treeListControl.InsertColumn(COL_SUBTREETOTAL, LoadString(IDS_TREECOL_SIZE), LVCFMT_RIGHT, 90, COL_SUBTREETOTAL);
- m_treeListControl.InsertColumn(COL_ITEMS, LoadString(IDS_TREECOL_ITEMS), LVCFMT_RIGHT, 55, COL_ITEMS);
- m_treeListControl.InsertColumn(COL_FILES, LoadString(IDS_TREECOL_FILES), LVCFMT_RIGHT, 55, COL_FILES);
- m_treeListControl.InsertColumn(COL_SUBDIRS, LoadString(IDS_TREECOL_SUBDIRS), LVCFMT_RIGHT, 55, COL_SUBDIRS);
- m_treeListControl.InsertColumn(COL_LASTCHANGE, LoadString(IDS_TREECOL_LASTCHANGE), LVCFMT_LEFT, 120, COL_LASTCHANGE);
- m_treeListControl.InsertColumn(COL_ATTRIBUTES, LoadString(IDS_TREECOL_ATTRIBUTES), LVCFMT_LEFT, 50, COL_ATTRIBUTES);
-
- m_treeListControl.OnColumnsInserted();
-
- m_treeListControl.MySetImageList(GetMyImageList());
-
- return 0;
-}
-
-BOOL CDirstatView::OnEraseBkgnd(CDC* /*pDC*/)
-{
- return true;
-}
-
-void CDirstatView::OnDestroy()
-{
- m_treeListControl.MySetImageList(NULL);
- CView::OnDestroy();
-}
-
-void CDirstatView::OnSetFocus(CWnd* /*pOldWnd*/)
-{
- m_treeListControl.SetFocus();
-}
-
-void CDirstatView::OnSettingChange(UINT uFlags, LPCTSTR lpszSection)
-{
- if(uFlags & SPI_SETNONCLIENTMETRICS)
- {
- FileIconInit(TRUE);
- }
- CView::OnSettingChange(uFlags, lpszSection);
-}
-
-void CDirstatView::OnLvnItemchanged(NMHDR *pNMHDR, LRESULT *pResult)
-{
- LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
-
- if((pNMLV->uChanged & LVIF_STATE) != 0)
- {
- if(pNMLV->iItem == -1)
- {
- ASSERT(false); // mal gucken
- }
- else
- {
- // This is not true (don't know why): ASSERT(m_treeListControl.GetItemState(pNMLV->iItem, LVIS_SELECTED) == pNMLV->uNewState);
- bool selected = ((m_treeListControl.GetItemState(pNMLV->iItem, LVIS_SELECTED) & LVIS_SELECTED) != 0);
- CItem *item = (CItem *)m_treeListControl.GetItem(pNMLV->iItem);
- ASSERT(item != NULL);
- if(selected)
- {
- GetDocument()->SetSelection(item);
- GetDocument()->UpdateAllViews(this, HINT_SELECTIONCHANGED);
- }
- }
- }
-
- *pResult = 0;
-}
-
-void CDirstatView::OnUpdate(CView *pSender, LPARAM lHint, CObject *pHint)
-{
- switch (lHint)
- {
- case HINT_NEWROOT:
- {
- m_treeListControl.SetRootItem(GetDocument()->GetRootItem());
- m_treeListControl.Sort();
- m_treeListControl.RedrawItems(0, m_treeListControl.GetItemCount() - 1);
- }
- break;
-
- case HINT_SELECTIONCHANGED:
- {
- // FIXME: Multi-select
- m_treeListControl.DeselectAll();
- for (size_t i = 0; i < GetDocument()->GetSelectionCount(); i++)
- {
- m_treeListControl.SelectItem(GetDocument()->GetSelection(i));
- }
- }
- break;
-
- case HINT_EXTENDSELECTION:
- {
- CItem *item = (CItem *)pHint;
- m_treeListControl.ExtendSelection(item);
- }
-
- case HINT_SHOWNEWSELECTION:
- {
- // FIXME: Multi-select
-// const CItem *item = (const CItem *)pHint;
- }
- break;
-
- case HINT_REDRAWWINDOW:
- {
- m_treeListControl.RedrawWindow();
- }
- break;
-
- case HINT_ZOOMCHANGED:
- {
- CView::OnUpdate(pSender, lHint, pHint);
- }
- break;
-
- case HINT_LISTSTYLECHANGED:
- {
- m_treeListControl.ShowGrid(GetOptions()->IsListGrid());
- m_treeListControl.ShowStripes(GetOptions()->IsListStripes());
- m_treeListControl.ShowFullRowSelection(GetOptions()->IsListFullRowSelection());
- }
- break;
-
- case HINT_SOMEWORKDONE:
- {
- MSG msg;
- while(::PeekMessage(&msg, m_treeListControl, 0, 0, PM_REMOVE))
- {
- if(msg.message == WM_QUIT)
- {
- ::PostQuitMessage(int(msg.wParam));
- break;
- }
- ::TranslateMessage(&msg);
- ::DispatchMessage(&msg);
- }
- }
- // fall through
- case 0:
- {
- m_treeListControl.Sort();
-
- // I decided (from 1.0.1 to 1.0.2) that this is not so good:
- // m_treeListControl.EnsureItemVisible(GetDocument()->GetSelection());
-
- CView::OnUpdate(pSender, lHint, pHint);
- }
- break;
-
- default:
- break;
- }
-}
-
-void CDirstatView::OnUpdatePopupToggle(CCmdUI *pCmdUI)
-{
- pCmdUI->Enable(m_treeListControl.SelectedItemCanToggle());
-}
-
-void CDirstatView::OnPopupToggle()
-{
- m_treeListControl.ToggleSelectedItem();
-}
-
-#ifdef _DEBUG
-void CDirstatView::AssertValid() const
-{
- CView::AssertValid();
-}
-
-void CDirstatView::Dump(CDumpContext& dc) const
-{
- CView::Dump(dc);
-}
-
-#endif //_DEBUG
+// dirstatview.cpp - Implementation of CDirstatView
+//
+// WinDirStat - Directory Statistics
+// Copyright (C) 2003-2005 Bernhard Seifert
+// Copyright (C) 2004-2016 WinDirStat team (windirstat.info)
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+//
+
+#include "stdafx.h"
+#include "windirstat.h"
+#include "dirstatdoc.h"
+#include "item.h"
+#include "mainframe.h"
+#include "dirstatview.h"
+#include "osspecific.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#endif
+
+namespace
+{
+ const UINT _nIdTreeListControl = 4711;
+}
+
+CMyTreeListControl::CMyTreeListControl(CDirstatView *dirstatView)
+ : CTreeListControl(dirstatView, 20)
+{
+}
+
+bool CMyTreeListControl::GetAscendingDefault(int column)
+{
+ return (column == COL_NAME || column == COL_LASTCHANGE);
+}
+
+BEGIN_MESSAGE_MAP(CMyTreeListControl, CTreeListControl)
+ ON_WM_CONTEXTMENU()
+ ON_WM_SETFOCUS()
+ ON_WM_KEYDOWN()
+END_MESSAGE_MAP()
+
+
+void CMyTreeListControl::OnContextMenu(CWnd* /*pWnd*/, CPoint pt)
+{
+ int i = GetSelectedItem();
+ if(i == -1)
+ {
+ return;
+ }
+
+ CTreeListItem *item = GetItem(i);
+
+ CRect rc = GetWholeSubitemRect(i, 0);
+ CRect rcTitle = item->GetTitleRect() + rc.TopLeft();
+
+ CMenu menu;
+ menu.LoadMenu(IDR_POPUPLIST);
+ CMenu *sub = menu.GetSubMenu(0);
+
+ PrepareDefaultMenu(sub, (CItem *)item);
+ GetMainFrame()->AppendUserDefinedCleanups(sub);
+
+ // Show popup menu and act accordingly.
+ //
+ // The menu shall not overlap the label but appear
+ // horizontally at the cursor position,
+ // vertically under (or above) the label.
+ // TrackPopupMenuEx() behaves in the desired way, if
+ // we exclude the label rectangle extended to full screen width.
+ //
+ // Thanks to Sven for this compromise between the old WinDirStat
+ // behavior (show the menu to the right of the label) and the
+ // Explorer behavior (show the menu at the cursor position).
+
+ TPMPARAMS tp;
+ tp.cbSize = sizeof(tp);
+ tp.rcExclude = rcTitle;
+ ClientToScreen(&tp.rcExclude);
+
+ CRect desktop;
+ GetDesktopWindow()->GetWindowRect(desktop);
+
+ tp.rcExclude.left = desktop.left;
+ tp.rcExclude.right = desktop.right;
+
+ const int overlap = 2; // a little vertical overlapping
+ tp.rcExclude.top += overlap;
+ tp.rcExclude.bottom -= overlap;
+
+ sub->TrackPopupMenuEx(TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, AfxGetMainWnd(), &tp);
+}
+
+void CMyTreeListControl::OnItemDoubleClick(int i)
+{
+ const CItem *item = (const CItem *)GetItem(i);
+ if(item->GetType() == IT_FILE)
+ {
+ GetDocument()->OpenItem(item);
+ }
+ else
+ {
+ CTreeListControl::OnItemDoubleClick(i);
+ }
+}
+
+void CMyTreeListControl::PrepareDefaultMenu(CMenu *menu, const CItem *item)
+{
+ if(IsLeaf(item->GetType()))
+ {
+ menu->DeleteMenu(0, MF_BYPOSITION); // Remove "Expand/Collapse" item
+ menu->DeleteMenu(0, MF_BYPOSITION); // Remove separator
+ menu->SetDefaultItem(ID_CLEANUP_OPEN, false);
+ }
+ else
+ {
+ CString command = LoadString(item->IsExpanded() && item->HasChildren() ? IDS_COLLAPSE : IDS_EXPAND);
+ VERIFY(menu->ModifyMenu(ID_POPUP_TOGGLE, MF_BYCOMMAND | MF_STRING, ID_POPUP_TOGGLE, command));
+ menu->SetDefaultItem(ID_POPUP_TOGGLE, false);
+ }
+}
+
+void CMyTreeListControl::OnSetFocus(CWnd* pOldWnd)
+{
+ CTreeListControl::OnSetFocus(pOldWnd);
+ GetMainFrame()->SetLogicalFocus(LF_DIRECTORYLIST);
+}
+
+void CMyTreeListControl::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
+{
+ if(nChar == VK_TAB)
+ {
+ GetMainFrame()->MoveFocus(LF_EXTENSIONLIST);
+ }
+ else if(nChar == VK_ESCAPE)
+ {
+ GetMainFrame()->MoveFocus(LF_NONE);
+ }
+ CTreeListControl::OnKeyDown(nChar, nRepCnt, nFlags);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+IMPLEMENT_DYNCREATE(CDirstatView, CView)
+
+CDirstatView::CDirstatView()
+ : m_treeListControl(this)
+{
+ m_treeListControl.SetSorting(COL_SUBTREETOTAL, false);
+}
+
+CDirstatView::~CDirstatView()
+{
+}
+
+CString CDirstatView::GenerateReport()
+{
+ CString report = GetOptions()->GetReportPrefix() + _T("\r\n");
+
+ for(size_t j = 0; j < GetDocument()->GetSelectionCount(); j++)
+ {
+ CItem *root = GetDocument()->GetSelection(j);
+ ASSERT(root != NULL);
+ ASSERT(root->IsVisible());
+
+ int r = m_treeListControl.FindTreeItem(root);
+
+ for(
+ int i = r;
+ i < m_treeListControl.GetItemCount()
+ && (i == r || m_treeListControl.GetItem(i)->GetIndent() > root->GetIndent());
+ i++
+ )
+ {
+ CItem *item = (CItem *)m_treeListControl.GetItem(i);
+
+ if(item->GetType() == IT_MYCOMPUTER)
+ {
+ continue;
+ }
+
+ report.AppendFormat(_T("%s %s\r\n"), PadWidthBlanks(FormatLongLongHuman(item->GetSize()), 11), item->GetReportPath());
+ }
+ }
+ report += _T("\r\n\r\n");
+ report += GetOptions()->GetReportSuffix();
+
+ return report;
+}
+
+// Just a shortcut for CMainFrame to obtain
+// the small font for the suspend button.
+CFont *CDirstatView::GetSmallFont()
+{
+ return m_treeListControl.GetFont();
+}
+
+void CDirstatView::SysColorChanged()
+{
+ m_treeListControl.SysColorChanged();
+}
+
+BOOL CDirstatView::PreCreateWindow(CREATESTRUCT& cs)
+{
+ return CView::PreCreateWindow(cs);
+}
+
+void CDirstatView::OnInitialUpdate()
+{
+ CView::OnInitialUpdate();
+}
+void CDirstatView::OnDraw(CDC* pDC)
+{
+ CView::OnDraw(pDC);
+}
+
+#ifdef _DEBUG
+CDirstatDoc* CDirstatView::GetDocument() const // Non debug version is inline
+{
+ ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDirstatDoc)));
+ return (CDirstatDoc*)m_pDocument;
+}
+#endif
+
+BEGIN_MESSAGE_MAP(CDirstatView, CView)
+ ON_WM_SIZE()
+ ON_WM_CREATE()
+ ON_WM_ERASEBKGND()
+ ON_WM_DESTROY()
+ ON_WM_SETFOCUS()
+ ON_WM_SETTINGCHANGE()
+ ON_NOTIFY(LVN_ITEMCHANGED, _nIdTreeListControl, OnLvnItemchanged)
+ ON_UPDATE_COMMAND_UI(ID_POPUP_TOGGLE, OnUpdatePopupToggle)
+ ON_COMMAND(ID_POPUP_TOGGLE, OnPopupToggle)
+END_MESSAGE_MAP()
+
+void CDirstatView::OnSize(UINT nType, int cx, int cy)
+{
+ CView::OnSize(nType, cx, cy);
+ if(::IsWindow(m_treeListControl.m_hWnd))
+ {
+ CRect rc(0, 0, cx, cy);
+ m_treeListControl.MoveWindow(rc);
+ }
+}
+
+int CDirstatView::OnCreate(LPCREATESTRUCT lpCreateStruct)
+{
+ if(CView::OnCreate(lpCreateStruct) == -1)
+ {
+ return -1;
+ }
+
+ RECT rect = { 0, 0, 0, 0 };
+ VERIFY(m_treeListControl.CreateEx(LVS_EX_HEADERDRAGDROP, WS_CHILD | WS_VISIBLE | LVS_REPORT | LVS_SHOWSELALWAYS, rect, this, _nIdTreeListControl));
+
+ m_treeListControl.ShowGrid(GetOptions()->IsListGrid());
+ m_treeListControl.ShowStripes(GetOptions()->IsListStripes());
+ m_treeListControl.ShowFullRowSelection(GetOptions()->IsListFullRowSelection());
+
+ m_treeListControl.InsertColumn(COL_NAME, LoadString(IDS_TREECOL_NAME), LVCFMT_LEFT, 200, COL_NAME);
+ m_treeListControl.InsertColumn(COL_SUBTREEPERCENTAGE, LoadString(IDS_TREECOL_SUBTREEPERCENTAGE), LVCFMT_RIGHT, CItem::GetSubtreePercentageWidth(), COL_SUBTREEPERCENTAGE);
+ m_treeListControl.InsertColumn(COL_PERCENTAGE, LoadString(IDS_TREECOL_PERCENTAGE), LVCFMT_RIGHT, 55, COL_PERCENTAGE);
+ m_treeListControl.InsertColumn(COL_SUBTREETOTAL, LoadString(IDS_TREECOL_SIZE), LVCFMT_RIGHT, 90, COL_SUBTREETOTAL);
+ m_treeListControl.InsertColumn(COL_ITEMS, LoadString(IDS_TREECOL_ITEMS), LVCFMT_RIGHT, 55, COL_ITEMS);
+ m_treeListControl.InsertColumn(COL_FILES, LoadString(IDS_TREECOL_FILES), LVCFMT_RIGHT, 55, COL_FILES);
+ m_treeListControl.InsertColumn(COL_SUBDIRS, LoadString(IDS_TREECOL_SUBDIRS), LVCFMT_RIGHT, 55, COL_SUBDIRS);
+ m_treeListControl.InsertColumn(COL_LASTCHANGE, LoadString(IDS_TREECOL_LASTCHANGE), LVCFMT_LEFT, 120, COL_LASTCHANGE);
+ m_treeListControl.InsertColumn(COL_ATTRIBUTES, LoadString(IDS_TREECOL_ATTRIBUTES), LVCFMT_LEFT, 50, COL_ATTRIBUTES);
+
+ m_treeListControl.OnColumnsInserted();
+
+ m_treeListControl.MySetImageList(GetMyImageList());
+
+ return 0;
+}
+
+BOOL CDirstatView::OnEraseBkgnd(CDC* /*pDC*/)
+{
+ return true;
+}
+
+void CDirstatView::OnDestroy()
+{
+ m_treeListControl.MySetImageList(NULL);
+ CView::OnDestroy();
+}
+
+void CDirstatView::OnSetFocus(CWnd* /*pOldWnd*/)
+{
+ m_treeListControl.SetFocus();
+}
+
+void CDirstatView::OnSettingChange(UINT uFlags, LPCTSTR lpszSection)
+{
+ if(uFlags & SPI_SETNONCLIENTMETRICS)
+ {
+ FileIconInit(TRUE);
+ }
+ CView::OnSettingChange(uFlags, lpszSection);
+}
+
+void CDirstatView::OnLvnItemchanged(NMHDR *pNMHDR, LRESULT *pResult)
+{
+ LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
+
+ if((pNMLV->uChanged & LVIF_STATE) != 0)
+ {
+ if(pNMLV->iItem == -1)
+ {
+ ASSERT(false); // mal gucken
+ }
+ else
+ {
+ // This is not true (don't know why): ASSERT(m_treeListControl.GetItemState(pNMLV->iItem, LVIS_SELECTED) == pNMLV->uNewState);
+ bool selected = ((m_treeListControl.GetItemState(pNMLV->iItem, LVIS_SELECTED) & LVIS_SELECTED) != 0);
+ CItem *item = (CItem *)m_treeListControl.GetItem(pNMLV->iItem);
+ ASSERT(item != NULL);
+ if(selected)
+ {
+ GetDocument()->SetSelection(item);
+ GetDocument()->UpdateAllViews(this, HINT_SELECTIONCHANGED);
+ }
+ }
+ }
+
+ *pResult = 0;
+}
+
+void CDirstatView::OnUpdate(CView *pSender, LPARAM lHint, CObject *pHint)
+{
+ switch (lHint)
+ {
+ case HINT_NEWROOT:
+ {
+ m_treeListControl.SetRootItem(GetDocument()->GetRootItem());
+ m_treeListControl.Sort();
+ m_treeListControl.RedrawItems(0, m_treeListControl.GetItemCount() - 1);
+ }
+ break;
+
+ case HINT_SELECTIONCHANGED:
+ {
+ // FIXME: Multi-select
+ m_treeListControl.DeselectAll();
+ for (size_t i = 0; i < GetDocument()->GetSelectionCount(); i++)
+ {
+ m_treeListControl.SelectItem(GetDocument()->GetSelection(i));
+ }
+ }
+ break;
+
+ case HINT_EXTENDSELECTION:
+ {
+ CItem *item = (CItem *)pHint;
+ m_treeListControl.ExtendSelection(item);
+ }
+
+ case HINT_SHOWNEWSELECTION:
+ {
+ // FIXME: Multi-select
+// const CItem *item = (const CItem *)pHint;
+ }
+ break;
+
+ case HINT_REDRAWWINDOW:
+ {
+ m_treeListControl.RedrawWindow();
+ }
+ break;
+
+ case HINT_ZOOMCHANGED:
+ {
+ CView::OnUpdate(pSender, lHint, pHint);
+ }
+ break;
+
+ case HINT_LISTSTYLECHANGED:
+ {
+ m_treeListControl.ShowGrid(GetOptions()->IsListGrid());
+ m_treeListControl.ShowStripes(GetOptions()->IsListStripes());
+ m_treeListControl.ShowFullRowSelection(GetOptions()->IsListFullRowSelection());
+ }
+ break;
+
+ case HINT_SOMEWORKDONE:
+ {
+ MSG msg;
+ while(::PeekMessage(&msg, m_treeListControl, 0, 0, PM_REMOVE))
+ {
+ if(msg.message == WM_QUIT)
+ {
+ ::PostQuitMessage(int(msg.wParam));
+ break;
+ }
+ ::TranslateMessage(&msg);
+ ::DispatchMessage(&msg);
+ }
+ }
+ // fall through
+ case 0:
+ {
+ m_treeListControl.Sort();
+
+ // I decided (from 1.0.1 to 1.0.2) that this is not so good:
+ // m_treeListControl.EnsureItemVisible(GetDocument()->GetSelection());
+
+ CView::OnUpdate(pSender, lHint, pHint);
+ }
+ break;
+
+ default:
+ break;
+ }
+}
+
+void CDirstatView::OnUpdatePopupToggle(CCmdUI *pCmdUI)
+{
+ pCmdUI->Enable(m_treeListControl.SelectedItemCanToggle());
+}
+
+void CDirstatView::OnPopupToggle()
+{
+ m_treeListControl.ToggleSelectedItem();
+}
+
+#ifdef _DEBUG
+void CDirstatView::AssertValid() const
+{
+ CView::AssertValid();
+}
+
+void CDirstatView::Dump(CDumpContext& dc) const
+{
+ CView::Dump(dc);
+}
+
+#endif //_DEBUG
diff --git a/windirstat/dirstatview.h b/windirstat/dirstatview.h
index c181d10..91d2aa1 100644
--- a/windirstat/dirstatview.h
+++ b/windirstat/dirstatview.h
@@ -1,105 +1,105 @@
-// dirstatview.h - Declaration of CMyTreeListControl and CDirstatView
-//
-// WinDirStat - Directory Statistics
-// Copyright (C) 2003-2005 Bernhard Seifert
-// Copyright (C) 2004-2016 WinDirStat team (windirstat.info)
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-//
-
-#ifndef __WDS_DIRSTATVIEW_H__
-#define __WDS_DIRSTATVIEW_H__
-#pragma once
-
-#include "TreeListControl.h"
-
-class CDirstatView;
-class CDirstatDoc;
-class CItem;
-
-//
-// CMyTreeListControl. I had to derive from CTreeListControl because
-// CTreeListControl doesn't know about the column constants (COL_***).
-//
-class CMyTreeListControl: public CTreeListControl
-{
-public:
- CMyTreeListControl(CDirstatView *dirstatView);
- virtual bool GetAscendingDefault(int column);
-
-protected:
- virtual void OnItemDoubleClick(int i);
-
- void PrepareDefaultMenu(CMenu *menu, const CItem *item);
-
- DECLARE_MESSAGE_MAP()
- afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/);
- afx_msg void OnSetFocus(CWnd* pOldWnd);
- afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
-};
-
-
-//
-// CDirstatView. The upper left view, which consists of the TreeList.
-//
-class CDirstatView: public CView
-{
-protected:
- CDirstatView(); // Created by MFC only
- DECLARE_DYNCREATE(CDirstatView)
-
-public:
- virtual ~CDirstatView();
- CString GenerateReport();
- CFont *GetSmallFont();
- void SysColorChanged();
-
-protected:
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- virtual void OnInitialUpdate();
- virtual void OnDraw(CDC* pDC);
- CDirstatDoc* GetDocument() const;
- virtual void OnUpdate(CView *pSender, LPARAM lHint, CObject *pHint);
-
- CMyTreeListControl m_treeListControl; // The tree list
-
-protected:
- DECLARE_MESSAGE_MAP()
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- afx_msg void OnDestroy();
- afx_msg void OnSetFocus(CWnd* pOldWnd);
- afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
- afx_msg void OnLvnItemchanged(NMHDR *pNMHDR, LRESULT *pResult);
- afx_msg void OnUpdatePopupToggle(CCmdUI *pCmdUI);
- afx_msg void OnPopupToggle();
-
-public:
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
-};
-
-#ifndef _DEBUG // Debug version in dirstatview.cpp
-inline CDirstatDoc* CDirstatView::GetDocument() const
-{
- return reinterpret_cast<CDirstatDoc*>(m_pDocument);
-}
-#endif
-
-#endif // __WDS_DIRSTATVIEW_H__
+// dirstatview.h - Declaration of CMyTreeListControl and CDirstatView
+//
+// WinDirStat - Directory Statistics
+// Copyright (C) 2003-2005 Bernhard Seifert
+// Copyright (C) 2004-2016 WinDirStat team (windirstat.info)
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+//
+
+#ifndef __WDS_DIRSTATVIEW_H__
+#define __WDS_DIRSTATVIEW_H__
+#pragma once
+
+#include "TreeListControl.h"
+
+class CDirstatView;
+class CDirstatDoc;
+class CItem;
+
+//
+// CMyTreeListControl. I had to derive from CTreeListControl because
+// CTreeListControl doesn't know about the column constants (COL_***).
+//
+class CMyTreeListControl: public CTreeListControl
+{
+public:
+ CMyTreeListControl(CDirstatView *dirstatView);
+ virtual bool GetAscendingDefault(int column);
+
+protected:
+ virtual void OnItemDoubleClick(int i);
+
+ void PrepareDefaultMenu(CMenu *menu, const CItem *item);
+
+ DECLARE_MESSAGE_MAP()
+ afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/);
+ afx_msg void OnSetFocus(CWnd* pOldWnd);
+ afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
+};
+
+
+//
+// CDirstatView. The upper left view, which consists of the TreeList.
+//
+class CDirstatView: public CView
+{
+protected:
+ CDirstatView(); // Created by MFC only
+ DECLARE_DYNCREATE(CDirstatView)
+
+public:
+ virtual ~CDirstatView();
+ CString GenerateReport();
+ CFont *GetSmallFont();
+ void SysColorChanged();
+
+protected:
+ virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
+ virtual void OnInitialUpdate();
+ virtual void OnDraw(CDC* pDC);
+ CDirstatDoc* GetDocument() const;
+ virtual void OnUpdate(CView *pSender, LPARAM lHint, CObject *pHint);
+
+ CMyTreeListControl m_treeListControl; // The tree list
+
+protected:
+ DECLARE_MESSAGE_MAP()
+ afx_msg void OnSize(UINT nType, int cx, int cy);
+ afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
+ afx_msg BOOL OnEraseBkgnd(CDC* pDC);
+ afx_msg void OnDestroy();
+ afx_msg void OnSetFocus(CWnd* pOldWnd);
+ afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
+ afx_msg void OnLvnItemchanged(NMHDR *pNMHDR, LRESULT *pResult);
+ afx_msg void OnUpdatePopupToggle(CCmdUI *pCmdUI);
+ afx_msg void OnPopupToggle();
+
+public:
+ #ifdef _DEBUG
+ virtual void AssertValid() const;
+ virtual void Dump(CDumpContext& dc) const;
+ #endif
+};
+
+#ifndef _DEBUG // Debug version in dirstatview.cpp
+inline CDirstatDoc* CDirstatView::GetDocument() const
+{
+ return reinterpret_cast<CDirstatDoc*>(m_pDocument);
+}
+#endif
+
+#endif // __WDS_DIRSTATVIEW_H__
diff --git a/windirstat/getosplatformstring.cpp b/windirstat/getosplatformstring.cpp
index b3f600a..2f2a2b9 100644
--- a/windirstat/getosplatformstring.cpp
+++ b/windirstat/getosplatformstring.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/getosplatformstring.h b/windirstat/getosplatformstring.h
index cbcee0b..2cfa6cc 100644
--- a/windirstat/getosplatformstring.h
+++ b/windirstat/getosplatformstring.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_GETOSPLATFORMSTRING_H__
#define __WDS_GETOSPLATFORMSTRING_H__
diff --git a/windirstat/globalhelpers.cpp b/windirstat/globalhelpers.cpp
index e898a03..7e3a87a 100644
--- a/windirstat/globalhelpers.cpp
+++ b/windirstat/globalhelpers.cpp
@@ -18,7 +18,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/globalhelpers.h b/windirstat/globalhelpers.h
index 9c59b6b..e4d1139 100644
--- a/windirstat/globalhelpers.h
+++ b/windirstat/globalhelpers.h
@@ -18,7 +18,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_GLOBALHELPERS_H__
#define __WDS_GLOBALHELPERS_H__
diff --git a/windirstat/helpmap.h b/windirstat/helpmap.h
index fbd41b3..d140bd9 100644
--- a/windirstat/helpmap.h
+++ b/windirstat/helpmap.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_HELPMAP_H__
#define __WDS_HELPMAP_H__
diff --git a/windirstat/item.cpp b/windirstat/item.cpp
index ef8da4b..4063811 100644
--- a/windirstat/item.cpp
+++ b/windirstat/item.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/item.h b/windirstat/item.h
index 9e5d0d5..53810e6 100644
--- a/windirstat/item.h
+++ b/windirstat/item.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_ITEM_H__
#define __WDS_ITEM_H__
diff --git a/windirstat/layout.cpp b/windirstat/layout.cpp
index 34b1616..86eec23 100644
--- a/windirstat/layout.cpp
+++ b/windirstat/layout.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/layout.h b/windirstat/layout.h
index c95ead6..5a8b5c6 100644
--- a/windirstat/layout.h
+++ b/windirstat/layout.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_LAYOUT_H__
#define __WDS_LAYOUT_H__
diff --git a/windirstat/mainframe.cpp b/windirstat/mainframe.cpp
index 0bb0a5c..cef0bba 100644
--- a/windirstat/mainframe.cpp
+++ b/windirstat/mainframe.cpp
@@ -1,1227 +1,1227 @@
-// mainframe.cpp - Implementation of CMySplitterWnd, CPacmanControl and CMainFrame
-//
-// WinDirStat - Directory Statistics
-// Copyright (C) 2003-2005 Bernhard Seifert
-// Copyright (C) 2004-2016 WinDirStat team (windirstat.info)
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-//
-
-#include "stdafx.h"
-#include "windirstat.h"
-
-#include "graphview.h"
-#include "dirstatview.h"
-#include "typeview.h"
-#include "dirstatdoc.h"
-#include "osspecific.h"
-#include "item.h"
-
-#include "pagecleanups.h"
-#include "pagetreelist.h"
-#include "pagetreemap.h"
-#include "pagegeneral.h"
-
-#include <common/version.h>
-
-#include "mainframe.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#endif
-
-namespace
-{
- // This must be synchronized with the IDR_MAINFRAME menu
- enum TOPLEVELMENU
- {
- TLM_FILE,
- TLM_EDIT,
- TLM_CLEANUP,
- TLM_TREEMAP,
- TLM_REPORT,
- TLM_VIEW,
- TLM_HELP
- };
-
- enum
- {
- // This is the position of the first "User defined cleanup" menu item in the "Cleanup" menu.
- // !!! MUST BE SYNCHRONIZED WITH THE MENU RESOURCE !!!
- MAINMENU_USERDEFINEDCLEANUP_POSITION = 11
- };
-
- enum
- {
- IDC_SUSPEND = 4712, // ID of "Suspend"-Button
- IDC_DEADFOCUS // ID of dead-focus window
- };
-
- // Clipboard-Opener
- class COpenClipboard
- {
- public:
- COpenClipboard(CWnd *owner, bool empty =true)
- {
- m_open = owner->OpenClipboard();
- if(!m_open)
- {
- MdThrowStringException(IDS_CANNOTOPENCLIPBOARD);
- }
- if(empty)
- {
- if(!EmptyClipboard())
- {
- MdThrowStringException(IDS_CANNOTEMTPYCLIPBOARD);
- }
- }
- }
- ~COpenClipboard()
- {
- if(m_open)
- {
- CloseClipboard();
- }
- }
- private:
- BOOL m_open;
- };
-
-
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-IMPLEMENT_DYNAMIC(COptionsPropertySheet, CPropertySheet)
-
-COptionsPropertySheet::COptionsPropertySheet()
- : CPropertySheet(IDS_WINDIRSTAT_SETTINGS)
- , m_restartApplication(false)
- , m_languageChanged(false)
- , m_alreadyAsked(false)
-{
-}
-
-void COptionsPropertySheet::SetLanguageChanged(bool changed)
-{
- m_languageChanged = changed;
-}
-
-BOOL COptionsPropertySheet::OnInitDialog()
-{
- BOOL bResult = CPropertySheet::OnInitDialog();
-
- CRect rc;
- GetWindowRect(rc);
- CPoint pt = rc.TopLeft();
- CPersistence::GetConfigPosition(pt);
- CRect rc2(pt, rc.Size());
- MoveWindow(rc2);
-
- SetActivePage(CPersistence::GetConfigPage(GetPageCount() - 1));
- return bResult;
-}
-
-BOOL COptionsPropertySheet::OnCommand(WPARAM wParam, LPARAM lParam)
-{
- CPersistence::SetConfigPage(GetActiveIndex());
-
- CRect rc;
- GetWindowRect(rc);
- CPersistence::SetConfigPosition(rc.TopLeft());
-
- int cmd = LOWORD(wParam);
- if((IDOK == cmd) || (ID_APPLY_NOW == cmd))
- {
- if(m_languageChanged && ((IDOK == cmd) || (!m_alreadyAsked)))
- {
- int r = AfxMessageBox(IDS_LANGUAGERESTARTNOW, MB_YESNOCANCEL);
- if(IDCANCEL == r)
- {
- return true; // "Message handled". Don't proceed.
- }
- else if(IDNO == r)
- {
- m_alreadyAsked = true; // Don't ask twice.
- }
- else
- {
- ASSERT(IDYES == r);
- m_restartApplication = true;
-
- if(ID_APPLY_NOW == cmd)
- {
- // This _posts_ a message...
- EndDialog(IDOK);
- // ... so after returning from this function, the OnOK()-handlers
- // of the pages will be called, before the sheet is closed.
- }
- }
- }
- }
-
- return CPropertySheet::OnCommand(wParam, lParam);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-CMySplitterWnd::CMySplitterWnd(LPCTSTR name)
- : m_persistenceName(name)
- , m_splitterPos(0.5)
-{
- CPersistence::GetSplitterPos(m_persistenceName, m_wasTrackedByUser, m_userSplitterPos);
-}
-
-BEGIN_MESSAGE_MAP(CMySplitterWnd, CSplitterWnd)
- ON_WM_SIZE()
- ON_WM_DESTROY()
-END_MESSAGE_MAP()
-
-void CMySplitterWnd::StopTracking(BOOL bAccept)
-{
- CSplitterWnd::StopTracking(bAccept);
-
- if(bAccept)
- {
- CRect rcClient;
- GetClientRect(rcClient);
-
- if(GetColumnCount() > 1)
- {
- int dummy;
- int cxLeft;
- GetColumnInfo(0, cxLeft, dummy);
-
- if(rcClient.Width() > 0)
- {
- m_splitterPos = (double)cxLeft / rcClient.Width();
- }
- }
- else
- {
- int dummy;
- int cyUpper;
- GetRowInfo(0, cyUpper, dummy);
-
- if(rcClient.Height() > 0)
- {
- m_splitterPos = (double)cyUpper / rcClient.Height();
- }
- }
- m_wasTrackedByUser = true;
- m_userSplitterPos = m_splitterPos;
- }
-}
-
-double CMySplitterWnd::GetSplitterPos()
-{
- return m_splitterPos;
-}
-
-void CMySplitterWnd::SetSplitterPos(double pos)
-{
- m_splitterPos = pos;
-
- CRect rcClient;
- GetClientRect(rcClient);
-
- if(GetColumnCount() > 1)
- {
- if(m_pColInfo != NULL)
- {
- int cxLeft = (int) (pos * rcClient.Width());
- if(cxLeft >= 0)
- {
- SetColumnInfo(0, cxLeft, 0);
- RecalcLayout();
- }
- }
- }
- else
- {
- if(m_pRowInfo != NULL)
- {
- int cyUpper = (int) (pos * rcClient.Height());
- if(cyUpper >= 0)
- {
- SetRowInfo(0, cyUpper, 0);
- RecalcLayout();
- }
- }
- }
-}
-
-void CMySplitterWnd::RestoreSplitterPos(double posIfVirgin)
-{
- if(m_wasTrackedByUser)
- {
- SetSplitterPos(m_userSplitterPos);
- }
- else
- {
- SetSplitterPos(posIfVirgin);
- }
-}
-
-void CMySplitterWnd::OnSize(UINT nType, int cx, int cy)
-{
- if(GetColumnCount() > 1)
- {
- int cxLeft = (int)(cx * m_splitterPos);
- if(cxLeft > 0)
- {
- SetColumnInfo(0, cxLeft, 0);
- }
- }
- else
- {
- int cyUpper = (int)(cy * m_splitterPos);
- if(cyUpper > 0)
- {
- SetRowInfo(0, cyUpper, 0);
- }
- }
- CSplitterWnd::OnSize(nType, cx, cy);
-}
-
-void CMySplitterWnd::OnDestroy()
-{
- CPersistence::SetSplitterPos(m_persistenceName, m_wasTrackedByUser, m_userSplitterPos);
- CSplitterWnd::OnDestroy();
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-CPacmanControl::CPacmanControl()
-{
- m_pacman.SetBackgroundColor(::GetSysColor(COLOR_BTNFACE));
- m_pacman.SetSpeed(0.00005);
-}
-
-void CPacmanControl::Drive(ULONGLONG readJobs)
-{
- if(::IsWindow(m_hWnd) && m_pacman.Drive(readJobs))
- {
- RedrawWindow();
- }
-}
-
-void CPacmanControl::Start(bool start)
-{
- m_pacman.Start(start);
-}
-
-BEGIN_MESSAGE_MAP(CPacmanControl, CStatic)
- ON_WM_PAINT()
- ON_WM_CREATE()
-END_MESSAGE_MAP()
-
-int CPacmanControl::OnCreate(LPCREATESTRUCT lpCreateStruct)
-{
- if(CStatic::OnCreate(lpCreateStruct) == -1)
- {
- return -1;
- }
-
- m_pacman.Reset();
- m_pacman.Start(true);
- return 0;
-}
-
-void CPacmanControl::OnPaint()
-{
- CPaintDC dc(this);
- CRect rc;
- GetClientRect(rc);
- m_pacman.Draw(&dc, rc);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-CDeadFocusWnd::CDeadFocusWnd()
-{
-}
-
-void CDeadFocusWnd::Create(CWnd *parent)
-{
- CRect rc(0,0,0,0);
- VERIFY(CWnd::Create(AfxRegisterWndClass(0, 0, 0, 0), _T("_deadfocus"), WS_CHILD, rc, parent, IDC_DEADFOCUS));
-}
-
-CDeadFocusWnd::~CDeadFocusWnd()
-{
- DestroyWindow();
-}
-
-BEGIN_MESSAGE_MAP(CDeadFocusWnd, CWnd)
- ON_WM_KEYDOWN()
-END_MESSAGE_MAP()
-
-void CDeadFocusWnd::OnKeyDown(UINT nChar, UINT /* nRepCnt */, UINT /* nFlags */)
-{
- if(nChar == VK_TAB)
- {
- GetMainFrame()->MoveFocus(LF_DIRECTORYLIST);
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////
-#ifdef SUPPORT_W7_TASKBAR
-UINT CMainFrame::s_taskBarMessage = ::RegisterWindowMessage(TEXT("TaskbarButtonCreated"));
-#endif // SUPPORT_W7_TASKBAR
-
-IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
-
-BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
- ON_WM_CREATE()
- ON_MESSAGE(WM_ENTERSIZEMOVE, OnEnterSizeMove)
- ON_MESSAGE(WM_EXITSIZEMOVE, OnExitSizeMove)
- ON_WM_CLOSE()
- ON_WM_INITMENUPOPUP()
- ON_UPDATE_COMMAND_UI(ID_INDICATOR_MEMORYUSAGE, OnUpdateMemoryUsage)
- ON_WM_SIZE()
- ON_UPDATE_COMMAND_UI(ID_VIEW_SHOWTREEMAP, OnUpdateViewShowtreemap)
- ON_COMMAND(ID_VIEW_SHOWTREEMAP, OnViewShowtreemap)
- ON_UPDATE_COMMAND_UI(ID_VIEW_SHOWFILETYPES, OnUpdateViewShowfiletypes)
- ON_COMMAND(ID_VIEW_SHOWFILETYPES, OnViewShowfiletypes)
- ON_COMMAND(ID_CONFIGURE, OnConfigure)
- ON_WM_DESTROY()
- ON_COMMAND(ID_TREEMAP_HELPABOUTTREEMAPS, OnTreemapHelpabouttreemaps)
- ON_BN_CLICKED(IDC_SUSPEND, OnBnClickedSuspend)
- ON_WM_SYSCOLORCHANGE()
-#ifdef SUPPORT_W7_TASKBAR
- ON_REGISTERED_MESSAGE(s_taskBarMessage, OnTaskButtonCreated)
-#endif // SUPPORT_W7_TASKBAR
-END_MESSAGE_MAP()
-
-static UINT indicators[] =
-{
- ID_SEPARATOR,
- ID_INDICATOR_MEMORYUSAGE,
- ID_INDICATOR_CAPS,
- ID_INDICATOR_NUM,
- ID_INDICATOR_SCRL,
-};
-
-static UINT indicatorsWithoutMemoryUsage[] =
-{
- ID_SEPARATOR,
- ID_INDICATOR_CAPS,
- ID_INDICATOR_NUM,
- ID_INDICATOR_SCRL,
-};
-
-
-CMainFrame *CMainFrame::_theFrame;
-
-CMainFrame *CMainFrame::GetTheFrame()
-{
- return _theFrame;
-}
-
-CMainFrame::CMainFrame()
- : m_wndSplitter(_T("main"))
- , m_wndSubSplitter(_T("sub"))
- , m_progressVisible(false)
- , m_progressRange(100)
- , m_logicalFocus(LF_NONE)
-#ifdef SUPPORT_W7_TASKBAR
- , m_TaskbarButtonState(TBPF_INDETERMINATE)
- , m_TaskbarButtonPreviousState(TBPF_INDETERMINATE)
-#endif // SUPPORT_W7_TASKBAR
-{
- _theFrame = this;
-}
-
-CMainFrame::~CMainFrame()
-{
- _theFrame = NULL;
-}
-
-#ifdef SUPPORT_W7_TASKBAR
-LRESULT CMainFrame::OnTaskButtonCreated(WPARAM, LPARAM)
-{
- if(!m_TaskbarList)
- {
- HRESULT hr = ::CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_ALL, IID_ITaskbarList3, reinterpret_cast<LPVOID*>(&m_TaskbarList));
- if(FAILED(hr))
- {
- VTRACE(_T("CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_ALL) failed %08X"), hr);
- }
- }
- return 0;
-}
-#endif // SUPPORT_W7_TASKBAR
-
-void CMainFrame::ShowProgress(ULONGLONG range)
-{
- // A range of 0 means that we have no range.
- // In this case we display pacman.
- HideProgress();
-
- if(GetOptions()->IsFollowMountPoints() || GetOptions()->IsFollowJunctionPoints())
- {
- range = 0;
- }
- m_progressRange = range;
- m_progressPos = 0;
- m_progressVisible = true;
- if(range > 0)
- {
- CreateStatusProgress();
- }
- else
- {
- CreatePacmanProgress();
- }
- UpdateProgress();
-}
-
-void CMainFrame::HideProgress()
-{
- DestroyProgress();
- if(m_progressVisible)
- {
- m_progressVisible = false;
- if(::IsWindow(*GetMainFrame()))
- {
- GetDocument()->SetTitlePrefix(wds::strEmpty);
- SetMessageText(AFX_IDS_IDLEMESSAGE);
- }
- }
-}
-
-void CMainFrame::SetProgressPos(ULONGLONG pos)
-{
- if(m_progressRange > 0 && pos > m_progressRange)
- {
- pos = m_progressRange;
- }
-
- m_progressPos = pos;
- UpdateProgress();
-}
-
-void CMainFrame::SetProgressPos100() // called by CDirstatDoc
-{
- if(m_progressRange > 0)
- {
- SetProgressPos(m_progressRange);
- }
-#ifdef SUPPORT_W7_TASKBAR
- if(m_TaskbarList)
- {
- m_TaskbarList->SetProgressState(*this, m_TaskbarButtonState = TBPF_NOPROGRESS);
- }
-#endif // SUPPORT_W7_TASKBAR
-}
-
-bool CMainFrame::IsProgressSuspended()
-{
- if(!::IsWindow(m_suspendButton.m_hWnd))
- {
- return false;
- }
- return ((m_suspendButton.GetState() & 0x3) != 0);
-}
-
-void CMainFrame::DrivePacman()
-{
- m_pacman.Drive(GetDocument()->GetWorkingItemReadJobs());
-}
-
-void CMainFrame::UpdateProgress()
-{
- if(m_progressVisible)
- {
- CString titlePrefix;
- CString suspended;
-
- if(IsProgressSuspended())
- {
- suspended.LoadString(IDS_SUSPENDED_);
- }
-
- if(m_progressRange > 0)
- {
- int pos = (int)((double) m_progressPos * 100 / m_progressRange);
- m_progress.SetPos(pos);
- titlePrefix.Format(_T("%d%% %s"), pos, suspended);
-#ifdef SUPPORT_W7_TASKBAR
- if(m_TaskbarList && (m_TaskbarButtonState != TBPF_PAUSED))
- {
- switch(pos)
- {
- // FIXME: hardcoded value here and elsewhere in this file
- case 100:
- m_TaskbarList->SetProgressState(*this, m_TaskbarButtonState = TBPF_INDETERMINATE); // often happens before we're finished
- break;
- default:
- m_TaskbarList->SetProgressState(*this, m_TaskbarButtonState = TBPF_NORMAL); // often happens before we're finished
- m_TaskbarList->SetProgressValue(*this, m_progressPos, m_progressRange);
- break;
- }
- }
-#endif // SUPPORT_W7_TASKBAR
- }
- else
- {
- titlePrefix = LoadString(IDS_SCANNING_) + suspended;
- }
-
- GetDocument()->SetTitlePrefix(titlePrefix);
- }
-}
-
-void CMainFrame::CreateStatusProgress()
-{
- if(m_progress.m_hWnd == NULL)
- {
- CRect rc;
- m_wndStatusBar.GetItemRect(0, rc);
- CreateSuspendButton(rc);
- m_progress.Create(WS_CHILD | WS_VISIBLE, rc, &m_wndStatusBar, 4711);
- m_progress.ModifyStyle(WS_BORDER, 0); // Doesn't help with XP-style control.
- }
-#ifdef SUPPORT_W7_TASKBAR
- if(m_TaskbarList)
- {
- m_TaskbarList->SetProgressState(*this, m_TaskbarButtonState = TBPF_INDETERMINATE);
- }
-#endif // SUPPORT_W7_TASKBAR
-}
-
-void CMainFrame::CreatePacmanProgress()
-{
- if(m_pacman.m_hWnd == NULL)
- {
- CRect rc;
- m_wndStatusBar.GetItemRect(0, rc);
- CreateSuspendButton(rc);
- m_pacman.Create(wds::strEmpty, WS_CHILD | WS_VISIBLE, rc, &m_wndStatusBar, 4711); // FIXME: hard-coded value out
- }
-}
-
-// rc [in]: Rect of status pane
-// rc [out]: Rest for progress/pacman-control
-void CMainFrame::CreateSuspendButton(CRect& rc)
-{
- CRect rcButton = rc;
- rcButton.right = rcButton.left + 80; // FIXME: hardcoded value
-
- VERIFY(m_suspendButton.Create(LoadString(IDS_SUSPEND), WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX | BS_PUSHLIKE, rcButton, &m_wndStatusBar, IDC_SUSPEND));
- m_suspendButton.SetFont(GetDirstatView()->GetSmallFont());
-
- rc.left = rcButton.right;
-}
-
-void CMainFrame::DestroyProgress()
-{
- if(::IsWindow(m_progress.m_hWnd))
- {
- m_progress.DestroyWindow();
- m_progress.m_hWnd = NULL;
- }
- else if(::IsWindow(m_pacman.m_hWnd))
- {
- m_pacman.DestroyWindow();
- m_pacman.m_hWnd = NULL;
- }
- if(::IsWindow(m_suspendButton.m_hWnd))
- {
- m_suspendButton.DestroyWindow();
- m_suspendButton.m_hWnd = NULL;
- }
-}
-
-void CMainFrame::OnBnClickedSuspend()
-{
- bool const isSuspended = IsProgressSuspended();
- m_pacman.Start(!isSuspended);
-#ifdef SUPPORT_W7_TASKBAR
- if(m_TaskbarList)
- {
- switch(m_TaskbarButtonState)
- {
- case TBPF_PAUSED:
- m_TaskbarList->SetProgressState(*this, m_TaskbarButtonState = m_TaskbarButtonPreviousState);
- break;
- default:
- m_TaskbarButtonPreviousState = m_TaskbarButtonState;
- m_TaskbarList->SetProgressState(*this, m_TaskbarButtonState = TBPF_PAUSED);
- break;
- }
- }
-#endif // SUPPORT_W7_TASKBAR
- UpdateProgress();
-}
-
-int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
-{
- if(CFrameWnd::OnCreate(lpCreateStruct) == -1)
- {
- return -1;
- }
-
- VERIFY(m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC));
- VERIFY(m_wndToolBar.LoadToolBar(IDR_MAINFRAME));
-
- UINT *indic = indicators;
- UINT size = countof(indicators);
-
- // If psapi is not supported, don't show that pane.
- if(GetWDSApp()->GetCurrentProcessMemoryInfo() == wds::strEmpty)
- {
- indic = indicatorsWithoutMemoryUsage;
- size = countof(indicatorsWithoutMemoryUsage);
- }
-
- VERIFY(m_wndStatusBar.Create(this));
- VERIFY(m_wndStatusBar.SetIndicators(indic, size));
- m_wndDeadFocus.Create(this);
-
- m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
- EnableDocking(CBRS_ALIGN_ANY);
- DockControlBar(&m_wndToolBar);
-
- LoadBarState(CPersistence::GetBarStateSection());
- ShowControlBar(&m_wndToolBar, CPersistence::GetShowToolbar(), false);
- ShowControlBar(&m_wndStatusBar, CPersistence::GetShowStatusbar(), false);
-
- return 0;
-}
-
-void CMainFrame::InitialShowWindow()
-{
- WINDOWPLACEMENT wp;
- wp.length = sizeof(wp);
- GetWindowPlacement(&wp);
- CPersistence::GetMainWindowPlacement(wp);
- MakeSaneShowCmd(wp.showCmd);
- SetWindowPlacement(&wp);
-}
-
-void CMainFrame::MakeSaneShowCmd(UINT& u)
-{
- switch (u)
- {
- default:
- case SW_HIDE:
- case SW_MINIMIZE:
- case SW_SHOWMINNOACTIVE:
- case SW_SHOWNA:
- case SW_SHOWMINIMIZED:
- case SW_SHOWNOACTIVATE:
- case SW_RESTORE:
- case SW_FORCEMINIMIZE:
- case SW_SHOWDEFAULT:
- case SW_SHOW:
- case SW_SHOWNORMAL:
- {
- u = SW_SHOWNORMAL;
- }
- break;
- case SW_SHOWMAXIMIZED:
- break;
- }
-}
-
-void CMainFrame::OnClose()
-{
- CWaitCursor wc;
-
- // It's too late, to do this in OnDestroy(). Because the toolbar, if undocked,
- // is already destroyed in OnDestroy(). So we must save the toolbar state here
- // in OnClose().
- SaveBarState(CPersistence::GetBarStateSection());
- CPersistence::SetShowToolbar((m_wndToolBar.GetStyle() & WS_VISIBLE) != 0);
- CPersistence::SetShowStatusbar((m_wndStatusBar.GetStyle() & WS_VISIBLE) != 0);
-
-#ifdef _DEBUG
- // avoid memory leaks an show hourglass while deleting the tree
- GetDocument()->OnNewDocument();
-#endif
-
- GetDocument()->ForgetItemTree();
- CFrameWnd::OnClose();
-}
-
-void CMainFrame::OnDestroy()
-{
- WINDOWPLACEMENT wp;
- wp.length = sizeof(wp);
- GetWindowPlacement(&wp);
- CPersistence::SetMainWindowPlacement(wp);
-
- CPersistence::SetShowFileTypes(GetTypeView()->IsShowTypes());
- CPersistence::SetShowTreemap(GetGraphView()->IsShowTreemap());
-
- CFrameWnd::OnDestroy();
-}
-
-BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
-{
- VERIFY(m_wndSplitter.CreateStatic(this, 2, 1));
- VERIFY(m_wndSplitter.CreateView(1, 0, RUNTIME_CLASS(CGraphView), CSize(100, 100), pContext));
- VERIFY(m_wndSubSplitter.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD | WS_VISIBLE | WS_BORDER, m_wndSplitter.IdFromRowCol(0, 0)));
- VERIFY(m_wndSubSplitter.CreateView(0, 0, RUNTIME_CLASS(CDirstatView), CSize(700, 500), pContext));
- VERIFY(m_wndSubSplitter.CreateView(0, 1, RUNTIME_CLASS(CTypeView), CSize(100, 500), pContext));
-
- MinimizeGraphView();
- MinimizeTypeView();
-
- GetTypeView()->ShowTypes(CPersistence::GetShowFileTypes());
- GetGraphView()->ShowTreemap(CPersistence::GetShowTreemap());
-
- return TRUE;
-}
-
-BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
-{
- if( !CFrameWnd::PreCreateWindow(cs) )
- {
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-// CMainFrame Diagnose
-
-#ifdef _DEBUG
-void CMainFrame::AssertValid() const
-{
- CFrameWnd::AssertValid();
-}
-
-void CMainFrame::Dump(CDumpContext& dc) const
-{
- CFrameWnd::Dump(dc);
-}
-
-#endif //_DEBUG
-
-void CMainFrame::MinimizeTypeView()
-{
- m_wndSubSplitter.SetSplitterPos(1.0);
-}
-
-void CMainFrame::RestoreTypeView()
-{
- if(GetTypeView()->IsShowTypes())
- {
- m_wndSubSplitter.RestoreSplitterPos(0.72);
- GetTypeView()->RedrawWindow();
- }
-}
-
-void CMainFrame::MinimizeGraphView()
-{
- m_wndSplitter.SetSplitterPos(1.0);
-}
-
-void CMainFrame::RestoreGraphView()
-{
- if(GetGraphView()->IsShowTreemap())
- {
- m_wndSplitter.RestoreSplitterPos(0.4);
- GetGraphView()->DrawEmptyView();
- GetGraphView()->RedrawWindow();
- }
-}
-
-CDirstatView* CMainFrame::GetDirstatView()
-{
- CWnd* pWnd = m_wndSubSplitter.GetPane(0, 0);
- CDirstatView* pView = DYNAMIC_DOWNCAST(CDirstatView, pWnd);
- return pView;
-}
-
-CGraphView *CMainFrame::GetGraphView()
-{
- CWnd *pWnd = m_wndSplitter.GetPane(1, 0);
- CGraphView *pView = DYNAMIC_DOWNCAST(CGraphView, pWnd);
- return pView;
-}
-
-CTypeView *CMainFrame::GetTypeView()
-{
- CWnd *pWnd = m_wndSubSplitter.GetPane(0, 1);
- CTypeView *pView = DYNAMIC_DOWNCAST(CTypeView, pWnd);
- return pView;
-}
-
-LRESULT CMainFrame::OnEnterSizeMove(WPARAM, LPARAM)
-{
- GetGraphView()->SuspendRecalculation(true);
- return 0;
-}
-
-LRESULT CMainFrame::OnExitSizeMove(WPARAM, LPARAM)
-{
- GetGraphView()->SuspendRecalculation(false);
- return 0;
-}
-
-void CMainFrame::CopyToClipboard(LPCTSTR psz)
-{
- try
- {
- COpenClipboard clipboard(this);
- SIZE_T cchBufLen = _tcslen(psz) + 1;
-
- HGLOBAL h = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, (cchBufLen) * sizeof(TCHAR));
- if(h == NULL)
- {
- MdThrowStringException(_T("GlobalAlloc failed."));
- }
-
- LPVOID lp = ::GlobalLock(h);
- ASSERT(lp != NULL);
-
- _tcscpy_s((LPTSTR)lp, cchBufLen, psz);
-
- ::GlobalUnlock(h);
-
- UINT uFormat = CF_TEXT;
-#ifdef UNICODE
- uFormat = CF_UNICODETEXT;
-#endif
- if(NULL == ::SetClipboardData(uFormat, h))
- {
- MdThrowStringException(IDS_CANNOTSETCLIPBAORDDATA);
- }
- }
- catch (CException *pe)
- {
- pe->ReportError();
- pe->Delete();
- }
-}
-
-void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu)
-{
- CFrameWnd::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
-
- if(!bSysMenu)
- {
- switch (nIndex)
- {
- case TLM_CLEANUP:
- {
- UpdateCleanupMenu(pPopupMenu);
- }
- break;
- }
- }
-}
-
-void CMainFrame::UpdateCleanupMenu(CMenu *menu)
-{
- CString s = LoadString(IDS_EMPTYRECYCLEBIN);
- VERIFY(menu->ModifyMenu(ID_CLEANUP_EMPTYRECYCLEBIN, MF_BYCOMMAND | MF_STRING, ID_CLEANUP_EMPTYRECYCLEBIN, s));
- // TODO: can be cleaned, so that we don't disable and then enable the menu item
- menu->EnableMenuItem(ID_CLEANUP_EMPTYRECYCLEBIN, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
-
- ULONGLONG items;
- ULONGLONG bytes;
-
- queryRecycleBin(items, bytes);
-
- CString info;
- if(items == 1)
- {
- info.FormatMessage(IDS__ONEITEMss, FormatBytes(bytes), GetOptions()->IsHumanFormat() && bytes != 0 ? wds::strEmpty : wds::strBlankSpace + GetSpec_Bytes());
- }
- else
- {
- info.FormatMessage(IDS__sITEMSss, FormatCount(items), FormatBytes(bytes), GetOptions()->IsHumanFormat() && bytes != 0 ? wds::strEmpty : wds::strBlankSpace + GetSpec_Bytes());
- }
-
- s += info;
- VERIFY(menu->ModifyMenu(ID_CLEANUP_EMPTYRECYCLEBIN, MF_BYCOMMAND | MF_STRING, ID_CLEANUP_EMPTYRECYCLEBIN, s));
-
- // ModifyMenu() re-enables the item. So we disable (or enable) it again.
-
- UINT flags = (items > 0 ? MF_ENABLED : MF_DISABLED | MF_GRAYED);
- flags |= MF_BYCOMMAND;
-
- menu->EnableMenuItem(ID_CLEANUP_EMPTYRECYCLEBIN, flags);
-
- UINT toRemove = menu->GetMenuItemCount() - MAINMENU_USERDEFINEDCLEANUP_POSITION;
- for(UINT i = 0; i < toRemove; i++)
- {
- menu->RemoveMenu(MAINMENU_USERDEFINEDCLEANUP_POSITION, MF_BYPOSITION);
- }
-
- AppendUserDefinedCleanups(menu);
-}
-
-void CMainFrame::queryRecycleBin(ULONGLONG& items, ULONGLONG& bytes)
-{
- // On W2k, the first parameter to SHQueryRecycleBin must not be NULL.
- // So we must sum the item counts and sizes of the recycle bins of all local drives.
-
- items = 0;
- bytes = 0;
-
- DWORD drives = ::GetLogicalDrives();
- int i;
- DWORD mask = 0x00000001;
- for(i = 0; i < wds::iNumDriveLetters; i++, mask <<= 1)
- {
- if((drives & mask) == 0)
- {
- continue;
- }
-
- CString s;
- s.Format(_T("%c:\\"), i + wds::chrCapA);
-
- UINT type = ::GetDriveType(s);
- if(type == DRIVE_UNKNOWN || type == DRIVE_NO_ROOT_DIR)
- {
- continue;
- }
-
- if(type == DRIVE_REMOTE)
- {
- continue;
- }
-
- SHQUERYRBINFO qbi;
- ZeroMemory(&qbi, sizeof(qbi));
- qbi.cbSize = sizeof(qbi);
-
- HRESULT hr = ::SHQueryRecycleBin(s, &qbi);
-
- if(FAILED(hr))
- {
- continue;
- }
-
- items += qbi.i64NumItems;
- bytes += qbi.i64Size;
- }
-}
-
-void CMainFrame::AppendUserDefinedCleanups(CMenu *menu)
-{
- CArray<int, int> indices;
- GetOptions()->GetEnabledUserDefinedCleanups(indices);
- if(indices.GetSize() > 0)
- {
- for(int i = 0; i < indices.GetSize(); i++)
- {
- CString string;
- string.FormatMessage(IDS_UDCsCTRLd, GetOptions()->GetUserDefinedCleanup(indices[i])->title, indices[i]);
-
- UINT flags = MF_GRAYED | MF_DISABLED;
- if(
- GetLogicalFocus() == LF_DIRECTORYLIST
- // FIXME: Multi-select
- && GetDocument()->UserDefinedCleanupWorksForItem(GetOptions()->GetUserDefinedCleanup(indices[i]), GetDocument()->GetSelection(0))
- )
- {
- flags = MF_ENABLED;
- }
- menu->AppendMenu(flags|MF_STRING, ID_USERDEFINEDCLEANUP0 + indices[i], string);
- }
- }
- else
- {
- // This is just to show new users, that they can configure user defined cleanups.
- menu->AppendMenu(MF_GRAYED, 0, LoadString(IDS_USERDEFINEDCLEANUP0));
- }
-}
-
-void CMainFrame::SetLogicalFocus(LOGICAL_FOCUS lf)
-{
- if(lf != m_logicalFocus)
- {
- m_logicalFocus = lf;
- SetSelectionMessageText();
-
- GetDocument()->UpdateAllViews(NULL, HINT_SELECTIONSTYLECHANGED);
- }
-}
-
-LOGICAL_FOCUS CMainFrame::GetLogicalFocus()
-{
- return m_logicalFocus;
-}
-
-void CMainFrame::MoveFocus(LOGICAL_FOCUS lf)
-{
- switch (lf)
- {
- case LF_NONE:
- {
- SetLogicalFocus(LF_NONE);
- m_wndDeadFocus.SetFocus();
- }
- break;
- case LF_DIRECTORYLIST:
- {
- GetDirstatView()->SetFocus();
- }
- break;
- case LF_EXTENSIONLIST:
- {
- GetTypeView()->SetFocus();
- }
- break;
- }
-}
-
-void CMainFrame::SetSelectionMessageText()
-{
- switch (GetLogicalFocus())
- {
- case LF_NONE:
- {
- SetMessageText(AFX_IDS_IDLEMESSAGE);
- }
- break;
- case LF_DIRECTORYLIST:
- // FIXME: Multi-select
- if(GetDocument()->GetSelection(0) != NULL)
- {
- // FIXME: Multi-select
- SetMessageText(GetDocument()->GetSelection(0)->GetPath());
- }
- else
- {
- SetMessageText(AFX_IDS_IDLEMESSAGE);
- }
- break;
- case LF_EXTENSIONLIST:
- {
- SetMessageText(wds::strStar + GetDocument()->GetHighlightExtension());
- }
- break;
- }
-}
-
-void CMainFrame::OnUpdateMemoryUsage(CCmdUI *pCmdUI)
-{
- pCmdUI->Enable(true);
- pCmdUI->SetText(GetWDSApp()->GetCurrentProcessMemoryInfo());
-}
-
-void CMainFrame::OnSize(UINT nType, int cx, int cy)
-{
- CFrameWnd::OnSize(nType, cx, cy);
-
- if(!::IsWindow(m_wndStatusBar.m_hWnd))
- {
- return;
- }
-
- CRect rc;
- m_wndStatusBar.GetItemRect(0, rc);
-
- if(m_suspendButton.m_hWnd != NULL)
- {
- CRect suspend;
- m_suspendButton.GetClientRect(suspend);
- rc.left = suspend.right;
- }
-
- if(m_progress.m_hWnd != NULL)
- {
- m_progress.MoveWindow(rc);
- }
- else if(m_pacman.m_hWnd != NULL)
- {
- m_pacman.MoveWindow(rc);
- }
-}
-
-void CMainFrame::OnUpdateViewShowtreemap(CCmdUI *pCmdUI)
-{
- pCmdUI->SetCheck(GetGraphView()->IsShowTreemap());
-}
-
-void CMainFrame::OnViewShowtreemap()
-{
- GetGraphView()->ShowTreemap(!GetGraphView()->IsShowTreemap());
- if(GetGraphView()->IsShowTreemap())
- {
- RestoreGraphView();
- }
- else
- {
- MinimizeGraphView();
- }
-}
-
-void CMainFrame::OnUpdateViewShowfiletypes(CCmdUI *pCmdUI)
-{
- pCmdUI->SetCheck(GetTypeView()->IsShowTypes());
-}
-
-void CMainFrame::OnViewShowfiletypes()
-{
- GetTypeView()->ShowTypes(!GetTypeView()->IsShowTypes());
- if(GetTypeView()->IsShowTypes())
- {
- RestoreTypeView();
- }
- else
- {
- MinimizeTypeView();
- }
-}
-
-void CMainFrame::OnConfigure()
-{
- COptionsPropertySheet sheet;
-
- CPageGeneral general;
- CPageTreelist treelist;
- CPageTreemap treemap;
- CPageCleanups cleanups;
-
- sheet.AddPage(&general);
- sheet.AddPage(&treelist);
- sheet.AddPage(&treemap);
- sheet.AddPage(&cleanups);
-
- sheet.DoModal();
-
- GetOptions()->SaveToRegistry();
-
- if(sheet.m_restartApplication)
- {
- GetWDSApp()->RestartApplication();
- }
-}
-
-void CMainFrame::OnTreemapHelpabouttreemaps()
-{
- GetWDSApp()->DoContextHelp(IDH_Treemap);
-}
-
-void CMainFrame::OnSysColorChange()
-{
- CFrameWnd::OnSysColorChange();
- GetDirstatView()->SysColorChanged();
- GetTypeView()->SysColorChanged();
-}
+// mainframe.cpp - Implementation of CMySplitterWnd, CPacmanControl and CMainFrame
+//
+// WinDirStat - Directory Statistics
+// Copyright (C) 2003-2005 Bernhard Seifert
+// Copyright (C) 2004-2016 WinDirStat team (windirstat.info)
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+//
+
+#include "stdafx.h"
+#include "windirstat.h"
+
+#include "graphview.h"
+#include "dirstatview.h"
+#include "typeview.h"
+#include "dirstatdoc.h"
+#include "osspecific.h"
+#include "item.h"
+
+#include "pagecleanups.h"
+#include "pagetreelist.h"
+#include "pagetreemap.h"
+#include "pagegeneral.h"
+
+#include <common/version.h>
+
+#include "mainframe.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#endif
+
+namespace
+{
+ // This must be synchronized with the IDR_MAINFRAME menu
+ enum TOPLEVELMENU
+ {
+ TLM_FILE,
+ TLM_EDIT,
+ TLM_CLEANUP,
+ TLM_TREEMAP,
+ TLM_REPORT,
+ TLM_VIEW,
+ TLM_HELP
+ };
+
+ enum
+ {
+ // This is the position of the first "User defined cleanup" menu item in the "Cleanup" menu.
+ // !!! MUST BE SYNCHRONIZED WITH THE MENU RESOURCE !!!
+ MAINMENU_USERDEFINEDCLEANUP_POSITION = 11
+ };
+
+ enum
+ {
+ IDC_SUSPEND = 4712, // ID of "Suspend"-Button
+ IDC_DEADFOCUS // ID of dead-focus window
+ };
+
+ // Clipboard-Opener
+ class COpenClipboard
+ {
+ public:
+ COpenClipboard(CWnd *owner, bool empty =true)
+ {
+ m_open = owner->OpenClipboard();
+ if(!m_open)
+ {
+ MdThrowStringException(IDS_CANNOTOPENCLIPBOARD);
+ }
+ if(empty)
+ {
+ if(!EmptyClipboard())
+ {
+ MdThrowStringException(IDS_CANNOTEMTPYCLIPBOARD);
+ }
+ }
+ }
+ ~COpenClipboard()
+ {
+ if(m_open)
+ {
+ CloseClipboard();
+ }
+ }
+ private:
+ BOOL m_open;
+ };
+
+
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+IMPLEMENT_DYNAMIC(COptionsPropertySheet, CPropertySheet)
+
+COptionsPropertySheet::COptionsPropertySheet()
+ : CPropertySheet(IDS_WINDIRSTAT_SETTINGS)
+ , m_restartApplication(false)
+ , m_languageChanged(false)
+ , m_alreadyAsked(false)
+{
+}
+
+void COptionsPropertySheet::SetLanguageChanged(bool changed)
+{
+ m_languageChanged = changed;
+}
+
+BOOL COptionsPropertySheet::OnInitDialog()
+{
+ BOOL bResult = CPropertySheet::OnInitDialog();
+
+ CRect rc;
+ GetWindowRect(rc);
+ CPoint pt = rc.TopLeft();
+ CPersistence::GetConfigPosition(pt);
+ CRect rc2(pt, rc.Size());
+ MoveWindow(rc2);
+
+ SetActivePage(CPersistence::GetConfigPage(GetPageCount() - 1));
+ return bResult;
+}
+
+BOOL COptionsPropertySheet::OnCommand(WPARAM wParam, LPARAM lParam)
+{
+ CPersistence::SetConfigPage(GetActiveIndex());
+
+ CRect rc;
+ GetWindowRect(rc);
+ CPersistence::SetConfigPosition(rc.TopLeft());
+
+ int cmd = LOWORD(wParam);
+ if((IDOK == cmd) || (ID_APPLY_NOW == cmd))
+ {
+ if(m_languageChanged && ((IDOK == cmd) || (!m_alreadyAsked)))
+ {
+ int r = AfxMessageBox(IDS_LANGUAGERESTARTNOW, MB_YESNOCANCEL);
+ if(IDCANCEL == r)
+ {
+ return true; // "Message handled". Don't proceed.
+ }
+ else if(IDNO == r)
+ {
+ m_alreadyAsked = true; // Don't ask twice.
+ }
+ else
+ {
+ ASSERT(IDYES == r);
+ m_restartApplication = true;
+
+ if(ID_APPLY_NOW == cmd)
+ {
+ // This _posts_ a message...
+ EndDialog(IDOK);
+ // ... so after returning from this function, the OnOK()-handlers
+ // of the pages will be called, before the sheet is closed.
+ }
+ }
+ }
+ }
+
+ return CPropertySheet::OnCommand(wParam, lParam);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+CMySplitterWnd::CMySplitterWnd(LPCTSTR name)
+ : m_persistenceName(name)
+ , m_splitterPos(0.5)
+{
+ CPersistence::GetSplitterPos(m_persistenceName, m_wasTrackedByUser, m_userSplitterPos);
+}
+
+BEGIN_MESSAGE_MAP(CMySplitterWnd, CSplitterWnd)
+ ON_WM_SIZE()
+ ON_WM_DESTROY()
+END_MESSAGE_MAP()
+
+void CMySplitterWnd::StopTracking(BOOL bAccept)
+{
+ CSplitterWnd::StopTracking(bAccept);
+
+ if(bAccept)
+ {
+ CRect rcClient;
+ GetClientRect(rcClient);
+
+ if(GetColumnCount() > 1)
+ {
+ int dummy;
+ int cxLeft;
+ GetColumnInfo(0, cxLeft, dummy);
+
+ if(rcClient.Width() > 0)
+ {
+ m_splitterPos = (double)cxLeft / rcClient.Width();
+ }
+ }
+ else
+ {
+ int dummy;
+ int cyUpper;
+ GetRowInfo(0, cyUpper, dummy);
+
+ if(rcClient.Height() > 0)
+ {
+ m_splitterPos = (double)cyUpper / rcClient.Height();
+ }
+ }
+ m_wasTrackedByUser = true;
+ m_userSplitterPos = m_splitterPos;
+ }
+}
+
+double CMySplitterWnd::GetSplitterPos()
+{
+ return m_splitterPos;
+}
+
+void CMySplitterWnd::SetSplitterPos(double pos)
+{
+ m_splitterPos = pos;
+
+ CRect rcClient;
+ GetClientRect(rcClient);
+
+ if(GetColumnCount() > 1)
+ {
+ if(m_pColInfo != NULL)
+ {
+ int cxLeft = (int) (pos * rcClient.Width());
+ if(cxLeft >= 0)
+ {
+ SetColumnInfo(0, cxLeft, 0);
+ RecalcLayout();
+ }
+ }
+ }
+ else
+ {
+ if(m_pRowInfo != NULL)
+ {
+ int cyUpper = (int) (pos * rcClient.Height());
+ if(cyUpper >= 0)
+ {
+ SetRowInfo(0, cyUpper, 0);
+ RecalcLayout();
+ }
+ }
+ }
+}
+
+void CMySplitterWnd::RestoreSplitterPos(double posIfVirgin)
+{
+ if(m_wasTrackedByUser)
+ {
+ SetSplitterPos(m_userSplitterPos);
+ }
+ else
+ {
+ SetSplitterPos(posIfVirgin);
+ }
+}
+
+void CMySplitterWnd::OnSize(UINT nType, int cx, int cy)
+{
+ if(GetColumnCount() > 1)
+ {
+ int cxLeft = (int)(cx * m_splitterPos);
+ if(cxLeft > 0)
+ {
+ SetColumnInfo(0, cxLeft, 0);
+ }
+ }
+ else
+ {
+ int cyUpper = (int)(cy * m_splitterPos);
+ if(cyUpper > 0)
+ {
+ SetRowInfo(0, cyUpper, 0);
+ }
+ }
+ CSplitterWnd::OnSize(nType, cx, cy);
+}
+
+void CMySplitterWnd::OnDestroy()
+{
+ CPersistence::SetSplitterPos(m_persistenceName, m_wasTrackedByUser, m_userSplitterPos);
+ CSplitterWnd::OnDestroy();
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+CPacmanControl::CPacmanControl()
+{
+ m_pacman.SetBackgroundColor(::GetSysColor(COLOR_BTNFACE));
+ m_pacman.SetSpeed(0.00005);
+}
+
+void CPacmanControl::Drive(ULONGLONG readJobs)
+{
+ if(::IsWindow(m_hWnd) && m_pacman.Drive(readJobs))
+ {
+ RedrawWindow();
+ }
+}
+
+void CPacmanControl::Start(bool start)
+{
+ m_pacman.Start(start);
+}
+
+BEGIN_MESSAGE_MAP(CPacmanControl, CStatic)
+ ON_WM_PAINT()
+ ON_WM_CREATE()
+END_MESSAGE_MAP()
+
+int CPacmanControl::OnCreate(LPCREATESTRUCT lpCreateStruct)
+{
+ if(CStatic::OnCreate(lpCreateStruct) == -1)
+ {
+ return -1;
+ }
+
+ m_pacman.Reset();
+ m_pacman.Start(true);
+ return 0;
+}
+
+void CPacmanControl::OnPaint()
+{
+ CPaintDC dc(this);
+ CRect rc;
+ GetClientRect(rc);
+ m_pacman.Draw(&dc, rc);
+}
+
+/////////////////////////////////////////////////////////////////////////////
+
+CDeadFocusWnd::CDeadFocusWnd()
+{
+}
+
+void CDeadFocusWnd::Create(CWnd *parent)
+{
+ CRect rc(0,0,0,0);
+ VERIFY(CWnd::Create(AfxRegisterWndClass(0, 0, 0, 0), _T("_deadfocus"), WS_CHILD, rc, parent, IDC_DEADFOCUS));
+}
+
+CDeadFocusWnd::~CDeadFocusWnd()
+{
+ DestroyWindow();
+}
+
+BEGIN_MESSAGE_MAP(CDeadFocusWnd, CWnd)
+ ON_WM_KEYDOWN()
+END_MESSAGE_MAP()
+
+void CDeadFocusWnd::OnKeyDown(UINT nChar, UINT /* nRepCnt */, UINT /* nFlags */)
+{
+ if(nChar == VK_TAB)
+ {
+ GetMainFrame()->MoveFocus(LF_DIRECTORYLIST);
+ }
+}
+
+/////////////////////////////////////////////////////////////////////////////
+#ifdef SUPPORT_W7_TASKBAR
+UINT CMainFrame::s_taskBarMessage = ::RegisterWindowMessage(TEXT("TaskbarButtonCreated"));
+#endif // SUPPORT_W7_TASKBAR
+
+IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
+
+BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
+ ON_WM_CREATE()
+ ON_MESSAGE(WM_ENTERSIZEMOVE, OnEnterSizeMove)
+ ON_MESSAGE(WM_EXITSIZEMOVE, OnExitSizeMove)
+ ON_WM_CLOSE()
+ ON_WM_INITMENUPOPUP()
+ ON_UPDATE_COMMAND_UI(ID_INDICATOR_MEMORYUSAGE, OnUpdateMemoryUsage)
+ ON_WM_SIZE()
+ ON_UPDATE_COMMAND_UI(ID_VIEW_SHOWTREEMAP, OnUpdateViewShowtreemap)
+ ON_COMMAND(ID_VIEW_SHOWTREEMAP, OnViewShowtreemap)
+ ON_UPDATE_COMMAND_UI(ID_VIEW_SHOWFILETYPES, OnUpdateViewShowfiletypes)
+ ON_COMMAND(ID_VIEW_SHOWFILETYPES, OnViewShowfiletypes)
+ ON_COMMAND(ID_CONFIGURE, OnConfigure)
+ ON_WM_DESTROY()
+ ON_COMMAND(ID_TREEMAP_HELPABOUTTREEMAPS, OnTreemapHelpabouttreemaps)
+ ON_BN_CLICKED(IDC_SUSPEND, OnBnClickedSuspend)
+ ON_WM_SYSCOLORCHANGE()
+#ifdef SUPPORT_W7_TASKBAR
+ ON_REGISTERED_MESSAGE(s_taskBarMessage, OnTaskButtonCreated)
+#endif // SUPPORT_W7_TASKBAR
+END_MESSAGE_MAP()
+
+static UINT indicators[] =
+{
+ ID_SEPARATOR,
+ ID_INDICATOR_MEMORYUSAGE,
+ ID_INDICATOR_CAPS,
+ ID_INDICATOR_NUM,
+ ID_INDICATOR_SCRL,
+};
+
+static UINT indicatorsWithoutMemoryUsage[] =
+{
+ ID_SEPARATOR,
+ ID_INDICATOR_CAPS,
+ ID_INDICATOR_NUM,
+ ID_INDICATOR_SCRL,
+};
+
+
+CMainFrame *CMainFrame::_theFrame;
+
+CMainFrame *CMainFrame::GetTheFrame()
+{
+ return _theFrame;
+}
+
+CMainFrame::CMainFrame()
+ : m_wndSplitter(_T("main"))
+ , m_wndSubSplitter(_T("sub"))
+ , m_progressVisible(false)
+ , m_progressRange(100)
+ , m_logicalFocus(LF_NONE)
+#ifdef SUPPORT_W7_TASKBAR
+ , m_TaskbarButtonState(TBPF_INDETERMINATE)
+ , m_TaskbarButtonPreviousState(TBPF_INDETERMINATE)
+#endif // SUPPORT_W7_TASKBAR
+{
+ _theFrame = this;
+}
+
+CMainFrame::~CMainFrame()
+{
+ _theFrame = NULL;
+}
+
+#ifdef SUPPORT_W7_TASKBAR
+LRESULT CMainFrame::OnTaskButtonCreated(WPARAM, LPARAM)
+{
+ if(!m_TaskbarList)
+ {
+ HRESULT hr = ::CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_ALL, IID_ITaskbarList3, reinterpret_cast<LPVOID*>(&m_TaskbarList));
+ if(FAILED(hr))
+ {
+ VTRACE(_T("CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_ALL) failed %08X"), hr);
+ }
+ }
+ return 0;
+}
+#endif // SUPPORT_W7_TASKBAR
+
+void CMainFrame::ShowProgress(ULONGLONG range)
+{
+ // A range of 0 means that we have no range.
+ // In this case we display pacman.
+ HideProgress();
+
+ if(GetOptions()->IsFollowMountPoints() || GetOptions()->IsFollowJunctionPoints())
+ {
+ range = 0;
+ }
+ m_progressRange = range;
+ m_progressPos = 0;
+ m_progressVisible = true;
+ if(range > 0)
+ {
+ CreateStatusProgress();
+ }
+ else
+ {
+ CreatePacmanProgress();
+ }
+ UpdateProgress();
+}
+
+void CMainFrame::HideProgress()
+{
+ DestroyProgress();
+ if(m_progressVisible)
+ {
+ m_progressVisible = false;
+ if(::IsWindow(*GetMainFrame()))
+ {
+ GetDocument()->SetTitlePrefix(wds::strEmpty);
+ SetMessageText(AFX_IDS_IDLEMESSAGE);
+ }
+ }
+}
+
+void CMainFrame::SetProgressPos(ULONGLONG pos)
+{
+ if(m_progressRange > 0 && pos > m_progressRange)
+ {
+ pos = m_progressRange;
+ }
+
+ m_progressPos = pos;
+ UpdateProgress();
+}
+
+void CMainFrame::SetProgressPos100() // called by CDirstatDoc
+{
+ if(m_progressRange > 0)
+ {
+ SetProgressPos(m_progressRange);
+ }
+#ifdef SUPPORT_W7_TASKBAR
+ if(m_TaskbarList)
+ {
+ m_TaskbarList->SetProgressState(*this, m_TaskbarButtonState = TBPF_NOPROGRESS);
+ }
+#endif // SUPPORT_W7_TASKBAR
+}
+
+bool CMainFrame::IsProgressSuspended()
+{
+ if(!::IsWindow(m_suspendButton.m_hWnd))
+ {
+ return false;
+ }
+ return ((m_suspendButton.GetState() & 0x3) != 0);
+}
+
+void CMainFrame::DrivePacman()
+{
+ m_pacman.Drive(GetDocument()->GetWorkingItemReadJobs());
+}
+
+void CMainFrame::UpdateProgress()
+{
+ if(m_progressVisible)
+ {
+ CString titlePrefix;
+ CString suspended;
+
+ if(IsProgressSuspended())
+ {
+ suspended.LoadString(IDS_SUSPENDED_);
+ }
+
+ if(m_progressRange > 0)
+ {
+ int pos = (int)((double) m_progressPos * 100 / m_progressRange);
+ m_progress.SetPos(pos);
+ titlePrefix.Format(_T("%d%% %s"), pos, suspended);
+#ifdef SUPPORT_W7_TASKBAR
+ if(m_TaskbarList && (m_TaskbarButtonState != TBPF_PAUSED))
+ {
+ switch(pos)
+ {
+ // FIXME: hardcoded value here and elsewhere in this file
+ case 100:
+ m_TaskbarList->SetProgressState(*this, m_TaskbarButtonState = TBPF_INDETERMINATE); // often happens before we're finished
+ break;
+ default:
+ m_TaskbarList->SetProgressState(*this, m_TaskbarButtonState = TBPF_NORMAL); // often happens before we're finished
+ m_TaskbarList->SetProgressValue(*this, m_progressPos, m_progressRange);
+ break;
+ }
+ }
+#endif // SUPPORT_W7_TASKBAR
+ }
+ else
+ {
+ titlePrefix = LoadString(IDS_SCANNING_) + suspended;
+ }
+
+ GetDocument()->SetTitlePrefix(titlePrefix);
+ }
+}
+
+void CMainFrame::CreateStatusProgress()
+{
+ if(m_progress.m_hWnd == NULL)
+ {
+ CRect rc;
+ m_wndStatusBar.GetItemRect(0, rc);
+ CreateSuspendButton(rc);
+ m_progress.Create(WS_CHILD | WS_VISIBLE, rc, &m_wndStatusBar, 4711);
+ m_progress.ModifyStyle(WS_BORDER, 0); // Doesn't help with XP-style control.
+ }
+#ifdef SUPPORT_W7_TASKBAR
+ if(m_TaskbarList)
+ {
+ m_TaskbarList->SetProgressState(*this, m_TaskbarButtonState = TBPF_INDETERMINATE);
+ }
+#endif // SUPPORT_W7_TASKBAR
+}
+
+void CMainFrame::CreatePacmanProgress()
+{
+ if(m_pacman.m_hWnd == NULL)
+ {
+ CRect rc;
+ m_wndStatusBar.GetItemRect(0, rc);
+ CreateSuspendButton(rc);
+ m_pacman.Create(wds::strEmpty, WS_CHILD | WS_VISIBLE, rc, &m_wndStatusBar, 4711); // FIXME: hard-coded value out
+ }
+}
+
+// rc [in]: Rect of status pane
+// rc [out]: Rest for progress/pacman-control
+void CMainFrame::CreateSuspendButton(CRect& rc)
+{
+ CRect rcButton = rc;
+ rcButton.right = rcButton.left + 80; // FIXME: hardcoded value
+
+ VERIFY(m_suspendButton.Create(LoadString(IDS_SUSPEND), WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX | BS_PUSHLIKE, rcButton, &m_wndStatusBar, IDC_SUSPEND));
+ m_suspendButton.SetFont(GetDirstatView()->GetSmallFont());
+
+ rc.left = rcButton.right;
+}
+
+void CMainFrame::DestroyProgress()
+{
+ if(::IsWindow(m_progress.m_hWnd))
+ {
+ m_progress.DestroyWindow();
+ m_progress.m_hWnd = NULL;
+ }
+ else if(::IsWindow(m_pacman.m_hWnd))
+ {
+ m_pacman.DestroyWindow();
+ m_pacman.m_hWnd = NULL;
+ }
+ if(::IsWindow(m_suspendButton.m_hWnd))
+ {
+ m_suspendButton.DestroyWindow();
+ m_suspendButton.m_hWnd = NULL;
+ }
+}
+
+void CMainFrame::OnBnClickedSuspend()
+{
+ bool const isSuspended = IsProgressSuspended();
+ m_pacman.Start(!isSuspended);
+#ifdef SUPPORT_W7_TASKBAR
+ if(m_TaskbarList)
+ {
+ switch(m_TaskbarButtonState)
+ {
+ case TBPF_PAUSED:
+ m_TaskbarList->SetProgressState(*this, m_TaskbarButtonState = m_TaskbarButtonPreviousState);
+ break;
+ default:
+ m_TaskbarButtonPreviousState = m_TaskbarButtonState;
+ m_TaskbarList->SetProgressState(*this, m_TaskbarButtonState = TBPF_PAUSED);
+ break;
+ }
+ }
+#endif // SUPPORT_W7_TASKBAR
+ UpdateProgress();
+}
+
+int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
+{
+ if(CFrameWnd::OnCreate(lpCreateStruct) == -1)
+ {
+ return -1;
+ }
+
+ VERIFY(m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC));
+ VERIFY(m_wndToolBar.LoadToolBar(IDR_MAINFRAME));
+
+ UINT *indic = indicators;
+ UINT size = countof(indicators);
+
+ // If psapi is not supported, don't show that pane.
+ if(GetWDSApp()->GetCurrentProcessMemoryInfo() == wds::strEmpty)
+ {
+ indic = indicatorsWithoutMemoryUsage;
+ size = countof(indicatorsWithoutMemoryUsage);
+ }
+
+ VERIFY(m_wndStatusBar.Create(this));
+ VERIFY(m_wndStatusBar.SetIndicators(indic, size));
+ m_wndDeadFocus.Create(this);
+
+ m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
+ EnableDocking(CBRS_ALIGN_ANY);
+ DockControlBar(&m_wndToolBar);
+
+ LoadBarState(CPersistence::GetBarStateSection());
+ ShowControlBar(&m_wndToolBar, CPersistence::GetShowToolbar(), false);
+ ShowControlBar(&m_wndStatusBar, CPersistence::GetShowStatusbar(), false);
+
+ return 0;
+}
+
+void CMainFrame::InitialShowWindow()
+{
+ WINDOWPLACEMENT wp;
+ wp.length = sizeof(wp);
+ GetWindowPlacement(&wp);
+ CPersistence::GetMainWindowPlacement(wp);
+ MakeSaneShowCmd(wp.showCmd);
+ SetWindowPlacement(&wp);
+}
+
+void CMainFrame::MakeSaneShowCmd(UINT& u)
+{
+ switch (u)
+ {
+ default:
+ case SW_HIDE:
+ case SW_MINIMIZE:
+ case SW_SHOWMINNOACTIVE:
+ case SW_SHOWNA:
+ case SW_SHOWMINIMIZED:
+ case SW_SHOWNOACTIVATE:
+ case SW_RESTORE:
+ case SW_FORCEMINIMIZE:
+ case SW_SHOWDEFAULT:
+ case SW_SHOW:
+ case SW_SHOWNORMAL:
+ {
+ u = SW_SHOWNORMAL;
+ }
+ break;
+ case SW_SHOWMAXIMIZED:
+ break;
+ }
+}
+
+void CMainFrame::OnClose()
+{
+ CWaitCursor wc;
+
+ // It's too late, to do this in OnDestroy(). Because the toolbar, if undocked,
+ // is already destroyed in OnDestroy(). So we must save the toolbar state here
+ // in OnClose().
+ SaveBarState(CPersistence::GetBarStateSection());
+ CPersistence::SetShowToolbar((m_wndToolBar.GetStyle() & WS_VISIBLE) != 0);
+ CPersistence::SetShowStatusbar((m_wndStatusBar.GetStyle() & WS_VISIBLE) != 0);
+
+#ifdef _DEBUG
+ // avoid memory leaks an show hourglass while deleting the tree
+ GetDocument()->OnNewDocument();
+#endif
+
+ GetDocument()->ForgetItemTree();
+ CFrameWnd::OnClose();
+}
+
+void CMainFrame::OnDestroy()
+{
+ WINDOWPLACEMENT wp;
+ wp.length = sizeof(wp);
+ GetWindowPlacement(&wp);
+ CPersistence::SetMainWindowPlacement(wp);
+
+ CPersistence::SetShowFileTypes(GetTypeView()->IsShowTypes());
+ CPersistence::SetShowTreemap(GetGraphView()->IsShowTreemap());
+
+ CFrameWnd::OnDestroy();
+}
+
+BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
+{
+ VERIFY(m_wndSplitter.CreateStatic(this, 2, 1));
+ VERIFY(m_wndSplitter.CreateView(1, 0, RUNTIME_CLASS(CGraphView), CSize(100, 100), pContext));
+ VERIFY(m_wndSubSplitter.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD | WS_VISIBLE | WS_BORDER, m_wndSplitter.IdFromRowCol(0, 0)));
+ VERIFY(m_wndSubSplitter.CreateView(0, 0, RUNTIME_CLASS(CDirstatView), CSize(700, 500), pContext));
+ VERIFY(m_wndSubSplitter.CreateView(0, 1, RUNTIME_CLASS(CTypeView), CSize(100, 500), pContext));
+
+ MinimizeGraphView();
+ MinimizeTypeView();
+
+ GetTypeView()->ShowTypes(CPersistence::GetShowFileTypes());
+ GetGraphView()->ShowTreemap(CPersistence::GetShowTreemap());
+
+ return TRUE;
+}
+
+BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
+{
+ if( !CFrameWnd::PreCreateWindow(cs) )
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+// CMainFrame Diagnose
+
+#ifdef _DEBUG
+void CMainFrame::AssertValid() const
+{
+ CFrameWnd::AssertValid();
+}
+
+void CMainFrame::Dump(CDumpContext& dc) const
+{
+ CFrameWnd::Dump(dc);
+}
+
+#endif //_DEBUG
+
+void CMainFrame::MinimizeTypeView()
+{
+ m_wndSubSplitter.SetSplitterPos(1.0);
+}
+
+void CMainFrame::RestoreTypeView()
+{
+ if(GetTypeView()->IsShowTypes())
+ {
+ m_wndSubSplitter.RestoreSplitterPos(0.72);
+ GetTypeView()->RedrawWindow();
+ }
+}
+
+void CMainFrame::MinimizeGraphView()
+{
+ m_wndSplitter.SetSplitterPos(1.0);
+}
+
+void CMainFrame::RestoreGraphView()
+{
+ if(GetGraphView()->IsShowTreemap())
+ {
+ m_wndSplitter.RestoreSplitterPos(0.4);
+ GetGraphView()->DrawEmptyView();
+ GetGraphView()->RedrawWindow();
+ }
+}
+
+CDirstatView* CMainFrame::GetDirstatView()
+{
+ CWnd* pWnd = m_wndSubSplitter.GetPane(0, 0);
+ CDirstatView* pView = DYNAMIC_DOWNCAST(CDirstatView, pWnd);
+ return pView;
+}
+
+CGraphView *CMainFrame::GetGraphView()
+{
+ CWnd *pWnd = m_wndSplitter.GetPane(1, 0);
+ CGraphView *pView = DYNAMIC_DOWNCAST(CGraphView, pWnd);
+ return pView;
+}
+
+CTypeView *CMainFrame::GetTypeView()
+{
+ CWnd *pWnd = m_wndSubSplitter.GetPane(0, 1);
+ CTypeView *pView = DYNAMIC_DOWNCAST(CTypeView, pWnd);
+ return pView;
+}
+
+LRESULT CMainFrame::OnEnterSizeMove(WPARAM, LPARAM)
+{
+ GetGraphView()->SuspendRecalculation(true);
+ return 0;
+}
+
+LRESULT CMainFrame::OnExitSizeMove(WPARAM, LPARAM)
+{
+ GetGraphView()->SuspendRecalculation(false);
+ return 0;
+}
+
+void CMainFrame::CopyToClipboard(LPCTSTR psz)
+{
+ try
+ {
+ COpenClipboard clipboard(this);
+ SIZE_T cchBufLen = _tcslen(psz) + 1;
+
+ HGLOBAL h = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, (cchBufLen) * sizeof(TCHAR));
+ if(h == NULL)
+ {
+ MdThrowStringException(_T("GlobalAlloc failed."));
+ }
+
+ LPVOID lp = ::GlobalLock(h);
+ ASSERT(lp != NULL);
+
+ _tcscpy_s((LPTSTR)lp, cchBufLen, psz);
+
+ ::GlobalUnlock(h);
+
+ UINT uFormat = CF_TEXT;
+#ifdef UNICODE
+ uFormat = CF_UNICODETEXT;
+#endif
+ if(NULL == ::SetClipboardData(uFormat, h))
+ {
+ MdThrowStringException(IDS_CANNOTSETCLIPBAORDDATA);
+ }
+ }
+ catch (CException *pe)
+ {
+ pe->ReportError();
+ pe->Delete();
+ }
+}
+
+void CMainFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu)
+{
+ CFrameWnd::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
+
+ if(!bSysMenu)
+ {
+ switch (nIndex)
+ {
+ case TLM_CLEANUP:
+ {
+ UpdateCleanupMenu(pPopupMenu);
+ }
+ break;
+ }
+ }
+}
+
+void CMainFrame::UpdateCleanupMenu(CMenu *menu)
+{
+ CString s = LoadString(IDS_EMPTYRECYCLEBIN);
+ VERIFY(menu->ModifyMenu(ID_CLEANUP_EMPTYRECYCLEBIN, MF_BYCOMMAND | MF_STRING, ID_CLEANUP_EMPTYRECYCLEBIN, s));
+ // TODO: can be cleaned, so that we don't disable and then enable the menu item
+ menu->EnableMenuItem(ID_CLEANUP_EMPTYRECYCLEBIN, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+
+ ULONGLONG items;
+ ULONGLONG bytes;
+
+ queryRecycleBin(items, bytes);
+
+ CString info;
+ if(items == 1)
+ {
+ info.FormatMessage(IDS__ONEITEMss, FormatBytes(bytes), GetOptions()->IsHumanFormat() && bytes != 0 ? wds::strEmpty : wds::strBlankSpace + GetSpec_Bytes());
+ }
+ else
+ {
+ info.FormatMessage(IDS__sITEMSss, FormatCount(items), FormatBytes(bytes), GetOptions()->IsHumanFormat() && bytes != 0 ? wds::strEmpty : wds::strBlankSpace + GetSpec_Bytes());
+ }
+
+ s += info;
+ VERIFY(menu->ModifyMenu(ID_CLEANUP_EMPTYRECYCLEBIN, MF_BYCOMMAND | MF_STRING, ID_CLEANUP_EMPTYRECYCLEBIN, s));
+
+ // ModifyMenu() re-enables the item. So we disable (or enable) it again.
+
+ UINT flags = (items > 0 ? MF_ENABLED : MF_DISABLED | MF_GRAYED);
+ flags |= MF_BYCOMMAND;
+
+ menu->EnableMenuItem(ID_CLEANUP_EMPTYRECYCLEBIN, flags);
+
+ UINT toRemove = menu->GetMenuItemCount() - MAINMENU_USERDEFINEDCLEANUP_POSITION;
+ for(UINT i = 0; i < toRemove; i++)
+ {
+ menu->RemoveMenu(MAINMENU_USERDEFINEDCLEANUP_POSITION, MF_BYPOSITION);
+ }
+
+ AppendUserDefinedCleanups(menu);
+}
+
+void CMainFrame::queryRecycleBin(ULONGLONG& items, ULONGLONG& bytes)
+{
+ // On W2k, the first parameter to SHQueryRecycleBin must not be NULL.
+ // So we must sum the item counts and sizes of the recycle bins of all local drives.
+
+ items = 0;
+ bytes = 0;
+
+ DWORD drives = ::GetLogicalDrives();
+ int i;
+ DWORD mask = 0x00000001;
+ for(i = 0; i < wds::iNumDriveLetters; i++, mask <<= 1)
+ {
+ if((drives & mask) == 0)
+ {
+ continue;
+ }
+
+ CString s;
+ s.Format(_T("%c:\\"), i + wds::chrCapA);
+
+ UINT type = ::GetDriveType(s);
+ if(type == DRIVE_UNKNOWN || type == DRIVE_NO_ROOT_DIR)
+ {
+ continue;
+ }
+
+ if(type == DRIVE_REMOTE)
+ {
+ continue;
+ }
+
+ SHQUERYRBINFO qbi;
+ ZeroMemory(&qbi, sizeof(qbi));
+ qbi.cbSize = sizeof(qbi);
+
+ HRESULT hr = ::SHQueryRecycleBin(s, &qbi);
+
+ if(FAILED(hr))
+ {
+ continue;
+ }
+
+ items += qbi.i64NumItems;
+ bytes += qbi.i64Size;
+ }
+}
+
+void CMainFrame::AppendUserDefinedCleanups(CMenu *menu)
+{
+ CArray<int, int> indices;
+ GetOptions()->GetEnabledUserDefinedCleanups(indices);
+ if(indices.GetSize() > 0)
+ {
+ for(int i = 0; i < indices.GetSize(); i++)
+ {
+ CString string;
+ string.FormatMessage(IDS_UDCsCTRLd, GetOptions()->GetUserDefinedCleanup(indices[i])->title, indices[i]);
+
+ UINT flags = MF_GRAYED | MF_DISABLED;
+ if(
+ GetLogicalFocus() == LF_DIRECTORYLIST
+ // FIXME: Multi-select
+ && GetDocument()->UserDefinedCleanupWorksForItem(GetOptions()->GetUserDefinedCleanup(indices[i]), GetDocument()->GetSelection(0))
+ )
+ {
+ flags = MF_ENABLED;
+ }
+ menu->AppendMenu(flags|MF_STRING, ID_USERDEFINEDCLEANUP0 + indices[i], string);
+ }
+ }
+ else
+ {
+ // This is just to show new users, that they can configure user defined cleanups.
+ menu->AppendMenu(MF_GRAYED, 0, LoadString(IDS_USERDEFINEDCLEANUP0));
+ }
+}
+
+void CMainFrame::SetLogicalFocus(LOGICAL_FOCUS lf)
+{
+ if(lf != m_logicalFocus)
+ {
+ m_logicalFocus = lf;
+ SetSelectionMessageText();
+
+ GetDocument()->UpdateAllViews(NULL, HINT_SELECTIONSTYLECHANGED);
+ }
+}
+
+LOGICAL_FOCUS CMainFrame::GetLogicalFocus()
+{
+ return m_logicalFocus;
+}
+
+void CMainFrame::MoveFocus(LOGICAL_FOCUS lf)
+{
+ switch (lf)
+ {
+ case LF_NONE:
+ {
+ SetLogicalFocus(LF_NONE);
+ m_wndDeadFocus.SetFocus();
+ }
+ break;
+ case LF_DIRECTORYLIST:
+ {
+ GetDirstatView()->SetFocus();
+ }
+ break;
+ case LF_EXTENSIONLIST:
+ {
+ GetTypeView()->SetFocus();
+ }
+ break;
+ }
+}
+
+void CMainFrame::SetSelectionMessageText()
+{
+ switch (GetLogicalFocus())
+ {
+ case LF_NONE:
+ {
+ SetMessageText(AFX_IDS_IDLEMESSAGE);
+ }
+ break;
+ case LF_DIRECTORYLIST:
+ // FIXME: Multi-select
+ if(GetDocument()->GetSelection(0) != NULL)
+ {
+ // FIXME: Multi-select
+ SetMessageText(GetDocument()->GetSelection(0)->GetPath());
+ }
+ else
+ {
+ SetMessageText(AFX_IDS_IDLEMESSAGE);
+ }
+ break;
+ case LF_EXTENSIONLIST:
+ {
+ SetMessageText(wds::strStar + GetDocument()->GetHighlightExtension());
+ }
+ break;
+ }
+}
+
+void CMainFrame::OnUpdateMemoryUsage(CCmdUI *pCmdUI)
+{
+ pCmdUI->Enable(true);
+ pCmdUI->SetText(GetWDSApp()->GetCurrentProcessMemoryInfo());
+}
+
+void CMainFrame::OnSize(UINT nType, int cx, int cy)
+{
+ CFrameWnd::OnSize(nType, cx, cy);
+
+ if(!::IsWindow(m_wndStatusBar.m_hWnd))
+ {
+ return;
+ }
+
+ CRect rc;
+ m_wndStatusBar.GetItemRect(0, rc);
+
+ if(m_suspendButton.m_hWnd != NULL)
+ {
+ CRect suspend;
+ m_suspendButton.GetClientRect(suspend);
+ rc.left = suspend.right;
+ }
+
+ if(m_progress.m_hWnd != NULL)
+ {
+ m_progress.MoveWindow(rc);
+ }
+ else if(m_pacman.m_hWnd != NULL)
+ {
+ m_pacman.MoveWindow(rc);
+ }
+}
+
+void CMainFrame::OnUpdateViewShowtreemap(CCmdUI *pCmdUI)
+{
+ pCmdUI->SetCheck(GetGraphView()->IsShowTreemap());
+}
+
+void CMainFrame::OnViewShowtreemap()
+{
+ GetGraphView()->ShowTreemap(!GetGraphView()->IsShowTreemap());
+ if(GetGraphView()->IsShowTreemap())
+ {
+ RestoreGraphView();
+ }
+ else
+ {
+ MinimizeGraphView();
+ }
+}
+
+void CMainFrame::OnUpdateViewShowfiletypes(CCmdUI *pCmdUI)
+{
+ pCmdUI->SetCheck(GetTypeView()->IsShowTypes());
+}
+
+void CMainFrame::OnViewShowfiletypes()
+{
+ GetTypeView()->ShowTypes(!GetTypeView()->IsShowTypes());
+ if(GetTypeView()->IsShowTypes())
+ {
+ RestoreTypeView();
+ }
+ else
+ {
+ MinimizeTypeView();
+ }
+}
+
+void CMainFrame::OnConfigure()
+{
+ COptionsPropertySheet sheet;
+
+ CPageGeneral general;
+ CPageTreelist treelist;
+ CPageTreemap treemap;
+ CPageCleanups cleanups;
+
+ sheet.AddPage(&general);
+ sheet.AddPage(&treelist);
+ sheet.AddPage(&treemap);
+ sheet.AddPage(&cleanups);
+
+ sheet.DoModal();
+
+ GetOptions()->SaveToRegistry();
+
+ if(sheet.m_restartApplication)
+ {
+ GetWDSApp()->RestartApplication();
+ }
+}
+
+void CMainFrame::OnTreemapHelpabouttreemaps()
+{
+ GetWDSApp()->DoContextHelp(IDH_Treemap);
+}
+
+void CMainFrame::OnSysColorChange()
+{
+ CFrameWnd::OnSysColorChange();
+ GetDirstatView()->SysColorChanged();
+ GetTypeView()->SysColorChanged();
+}
diff --git a/windirstat/mainframe.h b/windirstat/mainframe.h
index d35d159..3a31813 100644
--- a/windirstat/mainframe.h
+++ b/windirstat/mainframe.h
@@ -1,245 +1,245 @@
-// mainframe.h - Declaration of CMySplitterWnd and CMainFrame
-//
-// WinDirStat - Directory Statistics
-// Copyright (C) 2003-2005 Bernhard Seifert
-// Copyright (C) 2004-2016 WinDirStat team (windirstat.info)
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-//
-
-#ifndef __WDS_MAINFRAME_H__
-#define __WDS_MAINFRAME_H__
-#pragma once
-
-#include "pacman.h"
-#include <common/wds_constants.h>
-
-class CMySplitterWnd;
-class CMainFrame;
-
-class CDirstatView;
-class CGraphView;
-class CTypeView;
-
-//
-// The "logical focus" can be
-// - on the Directory List
-// - on the Extension List
-// Although these windows can loose the real focus, for instance
-// when a dialog box is opened, the logical focus will not be lost.
-//
-enum LOGICAL_FOCUS
-{
- LF_NONE,
- LF_DIRECTORYLIST,
- LF_EXTENSIONLIST
-};
-
-
-//
-// COptionsPropertySheet. The options dialog.
-//
-class COptionsPropertySheet: public CPropertySheet
-{
- DECLARE_DYNAMIC(COptionsPropertySheet)
-
-public:
- COptionsPropertySheet();
- void SetLanguageChanged(bool changed);
- virtual BOOL OnInitDialog();
-
- bool m_restartApplication; // [out]
-
-protected:
- virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
-
- bool m_languageChanged;
- bool m_alreadyAsked;
-};
-
-
-//
-// CMySplitterWnd. A CSplitterWnd with 2 columns or rows, which
-// knows about the current split ratio and retains it even when resized.
-//
-class CMySplitterWnd: public CSplitterWnd
-{
-public:
- CMySplitterWnd(LPCTSTR name);
- virtual void StopTracking(BOOL bAccept);
- double GetSplitterPos();
- void SetSplitterPos(double pos);
- void RestoreSplitterPos(double posIfVirgin);
-
-protected:
- CString m_persistenceName; // Name of object for CPersistence
- double m_splitterPos; // Current split ratio
- bool m_wasTrackedByUser; // True as soon as user has modified the splitter position
- double m_userSplitterPos; // Split ratio as set by the user
-
- DECLARE_MESSAGE_MAP()
- afx_msg void OnSize(UINT nType, int cx, int cy);
-public:
- afx_msg void OnDestroy();
-};
-
-//
-// CPacmanControl. Pacman on the status bar.
-//
-class CPacmanControl: public CStatic
-{
-public:
- CPacmanControl();
- void Drive(ULONGLONG readJobs);
- void Start(bool start);
-
-protected:
- CPacman m_pacman;
-
- DECLARE_MESSAGE_MAP()
- afx_msg void OnPaint();
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
-};
-
-//
-// CDeadFocusWnd. The focus in Windirstat can be on
-// - the directory list
-// - the extension list,
-// - or none of them. In this case the focus lies on
-// an invisible (zero-size) child of CMainFrame.
-// On VK_TAB CDeadFocusWnd moves the focus to the
-// directory list then.
-//
-class CDeadFocusWnd: public CWnd
-{
-public:
- CDeadFocusWnd();
- void Create(CWnd *parent);
- ~CDeadFocusWnd();
-
-protected:
- DECLARE_MESSAGE_MAP()
- afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
-};
-
-
-//
-// CMainFrame. The main application window.
-//
-class CMainFrame: public CFrameWnd
-{
-protected:
-#ifdef SUPPORT_W7_TASKBAR
- static UINT CMainFrame::s_taskBarMessage;
-#endif // SUPPORT_W7_TASKBAR
- static CMainFrame *_theFrame;
- CMainFrame(); // Created by MFC only
- DECLARE_DYNCREATE(CMainFrame)
-
-public:
- static CMainFrame *GetTheFrame();
- virtual ~CMainFrame();
- void InitialShowWindow();
-
- void RestoreGraphView();
- void RestoreTypeView();
- void MinimizeGraphView();
- void MinimizeTypeView();
- void CopyToClipboard(LPCTSTR psz);
-
- CDirstatView *GetDirstatView();
- CGraphView *GetGraphView();
- CTypeView *GetTypeView();
-
- void ShowProgress(ULONGLONG range);
- void HideProgress();
- void SetProgressPos(ULONGLONG pos);
- void SetProgressPos100();
- bool IsProgressSuspended();
- void DrivePacman();
-
- void UpdateProgress();
- void AppendUserDefinedCleanups(CMenu *menu);
-
- void SetLogicalFocus(LOGICAL_FOCUS lf);
- LOGICAL_FOCUS GetLogicalFocus();
- void MoveFocus(LOGICAL_FOCUS lf);
-
- void SetSelectionMessageText();
-
- static void queryRecycleBin(ULONGLONG& items, ULONGLONG& bytes);
-
-protected:
- virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- void MakeSaneShowCmd(UINT& u);
-
- void CreateStatusProgress();
- void CreatePacmanProgress();
- void CreateSuspendButton(CRect& rc);
- void DestroyProgress();
-
- void UpdateCleanupMenu(CMenu *menu);
-
- bool m_progressVisible; // True while progress must be shown (either pacman or progress bar)
- ULONGLONG m_progressRange; // Progress range. A range of 0 means that we have no range available. In this case we should display pacman.
- ULONGLONG m_progressPos; // Progress position (<= progressRange, or an item count in case of m_progressRang == 0)
-
- CMySplitterWnd m_wndSubSplitter; // Contains the two upper views
- CMySplitterWnd m_wndSplitter; // Contains (a) m_wndSubSplitter and (b) the graph view.
-
- CStatusBar m_wndStatusBar; // Status bar
- CToolBar m_wndToolBar; // Tool bar
- CProgressCtrl m_progress; // Progress control. Is Create()ed and Destroy()ed again every time.
- CPacmanControl m_pacman; // Static control for Pacman.
- CButton m_suspendButton;// Progress-Suspend-Button
-
- LOGICAL_FOCUS m_logicalFocus; // Which view has the logical focus
- CDeadFocusWnd m_wndDeadFocus; // Zero-size window which holds the focus if logical focus is "NONE"
-#ifdef SUPPORT_W7_TASKBAR
- CComPtr<ITaskbarList3> m_TaskbarList;
- TBPFLAG m_TaskbarButtonState, m_TaskbarButtonPreviousState;
-#endif // SUPPORT_W7_TASKBAR
-
- DECLARE_MESSAGE_MAP()
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg LRESULT OnEnterSizeMove(WPARAM, LPARAM);
- afx_msg LRESULT OnExitSizeMove(WPARAM, LPARAM);
- afx_msg void OnClose();
- afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
- afx_msg void OnUpdateMemoryUsage(CCmdUI *pCmdUI);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnUpdateViewShowtreemap(CCmdUI *pCmdUI);
- afx_msg void OnViewShowtreemap();
- afx_msg void OnUpdateViewShowfiletypes(CCmdUI *pCmdUI);
- afx_msg void OnViewShowfiletypes();
- afx_msg void OnConfigure();
- afx_msg void OnDestroy();
- afx_msg void OnBnClickedSuspend();
- afx_msg void OnTreemapHelpabouttreemaps();
-#ifdef SUPPORT_W7_TASKBAR
- afx_msg LRESULT OnTaskButtonCreated(WPARAM, LPARAM);
-#endif // SUPPORT_W7_TASKBAR
-
-public:
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
- afx_msg void OnSysColorChange();
-};
-
-#endif // __WDS_MAINFRAME_H__
+// mainframe.h - Declaration of CMySplitterWnd and CMainFrame
+//
+// WinDirStat - Directory Statistics
+// Copyright (C) 2003-2005 Bernhard Seifert
+// Copyright (C) 2004-2016 WinDirStat team (windirstat.info)
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+//
+
+#ifndef __WDS_MAINFRAME_H__
+#define __WDS_MAINFRAME_H__
+#pragma once
+
+#include "pacman.h"
+#include <common/wds_constants.h>
+
+class CMySplitterWnd;
+class CMainFrame;
+
+class CDirstatView;
+class CGraphView;
+class CTypeView;
+
+//
+// The "logical focus" can be
+// - on the Directory List
+// - on the Extension List
+// Although these windows can loose the real focus, for instance
+// when a dialog box is opened, the logical focus will not be lost.
+//
+enum LOGICAL_FOCUS
+{
+ LF_NONE,
+ LF_DIRECTORYLIST,
+ LF_EXTENSIONLIST
+};
+
+
+//
+// COptionsPropertySheet. The options dialog.
+//
+class COptionsPropertySheet: public CPropertySheet
+{
+ DECLARE_DYNAMIC(COptionsPropertySheet)
+
+public:
+ COptionsPropertySheet();
+ void SetLanguageChanged(bool changed);
+ virtual BOOL OnInitDialog();
+
+ bool m_restartApplication; // [out]
+
+protected:
+ virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
+
+ bool m_languageChanged;
+ bool m_alreadyAsked;
+};
+
+
+//
+// CMySplitterWnd. A CSplitterWnd with 2 columns or rows, which
+// knows about the current split ratio and retains it even when resized.
+//
+class CMySplitterWnd: public CSplitterWnd
+{
+public:
+ CMySplitterWnd(LPCTSTR name);
+ virtual void StopTracking(BOOL bAccept);
+ double GetSplitterPos();
+ void SetSplitterPos(double pos);
+ void RestoreSplitterPos(double posIfVirgin);
+
+protected:
+ CString m_persistenceName; // Name of object for CPersistence
+ double m_splitterPos; // Current split ratio
+ bool m_wasTrackedByUser; // True as soon as user has modified the splitter position
+ double m_userSplitterPos; // Split ratio as set by the user
+
+ DECLARE_MESSAGE_MAP()
+ afx_msg void OnSize(UINT nType, int cx, int cy);
+public:
+ afx_msg void OnDestroy();
+};
+
+//
+// CPacmanControl. Pacman on the status bar.
+//
+class CPacmanControl: public CStatic
+{
+public:
+ CPacmanControl();
+ void Drive(ULONGLONG readJobs);
+ void Start(bool start);
+
+protected:
+ CPacman m_pacman;
+
+ DECLARE_MESSAGE_MAP()
+ afx_msg void OnPaint();
+ afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
+};
+
+//
+// CDeadFocusWnd. The focus in Windirstat can be on
+// - the directory list
+// - the extension list,
+// - or none of them. In this case the focus lies on
+// an invisible (zero-size) child of CMainFrame.
+// On VK_TAB CDeadFocusWnd moves the focus to the
+// directory list then.
+//
+class CDeadFocusWnd: public CWnd
+{
+public:
+ CDeadFocusWnd();
+ void Create(CWnd *parent);
+ ~CDeadFocusWnd();
+
+protected:
+ DECLARE_MESSAGE_MAP()
+ afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
+};
+
+
+//
+// CMainFrame. The main application window.
+//
+class CMainFrame: public CFrameWnd
+{
+protected:
+#ifdef SUPPORT_W7_TASKBAR
+ static UINT CMainFrame::s_taskBarMessage;
+#endif // SUPPORT_W7_TASKBAR
+ static CMainFrame *_theFrame;
+ CMainFrame(); // Created by MFC only
+ DECLARE_DYNCREATE(CMainFrame)
+
+public:
+ static CMainFrame *GetTheFrame();
+ virtual ~CMainFrame();
+ void InitialShowWindow();
+
+ void RestoreGraphView();
+ void RestoreTypeView();
+ void MinimizeGraphView();
+ void MinimizeTypeView();
+ void CopyToClipboard(LPCTSTR psz);
+
+ CDirstatView *GetDirstatView();
+ CGraphView *GetGraphView();
+ CTypeView *GetTypeView();
+
+ void ShowProgress(ULONGLONG range);
+ void HideProgress();
+ void SetProgressPos(ULONGLONG pos);
+ void SetProgressPos100();
+ bool IsProgressSuspended();
+ void DrivePacman();
+
+ void UpdateProgress();
+ void AppendUserDefinedCleanups(CMenu *menu);
+
+ void SetLogicalFocus(LOGICAL_FOCUS lf);
+ LOGICAL_FOCUS GetLogicalFocus();
+ void MoveFocus(LOGICAL_FOCUS lf);
+
+ void SetSelectionMessageText();
+
+ static void queryRecycleBin(ULONGLONG& items, ULONGLONG& bytes);
+
+protected:
+ virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
+ virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
+ void MakeSaneShowCmd(UINT& u);
+
+ void CreateStatusProgress();
+ void CreatePacmanProgress();
+ void CreateSuspendButton(CRect& rc);
+ void DestroyProgress();
+
+ void UpdateCleanupMenu(CMenu *menu);
+
+ bool m_progressVisible; // True while progress must be shown (either pacman or progress bar)
+ ULONGLONG m_progressRange; // Progress range. A range of 0 means that we have no range available. In this case we should display pacman.
+ ULONGLONG m_progressPos; // Progress position (<= progressRange, or an item count in case of m_progressRang == 0)
+
+ CMySplitterWnd m_wndSubSplitter; // Contains the two upper views
+ CMySplitterWnd m_wndSplitter; // Contains (a) m_wndSubSplitter and (b) the graph view.
+
+ CStatusBar m_wndStatusBar; // Status bar
+ CToolBar m_wndToolBar; // Tool bar
+ CProgressCtrl m_progress; // Progress control. Is Create()ed and Destroy()ed again every time.
+ CPacmanControl m_pacman; // Static control for Pacman.
+ CButton m_suspendButton;// Progress-Suspend-Button
+
+ LOGICAL_FOCUS m_logicalFocus; // Which view has the logical focus
+ CDeadFocusWnd m_wndDeadFocus; // Zero-size window which holds the focus if logical focus is "NONE"
+#ifdef SUPPORT_W7_TASKBAR
+ CComPtr<ITaskbarList3> m_TaskbarList;
+ TBPFLAG m_TaskbarButtonState, m_TaskbarButtonPreviousState;
+#endif // SUPPORT_W7_TASKBAR
+
+ DECLARE_MESSAGE_MAP()
+ afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
+ afx_msg LRESULT OnEnterSizeMove(WPARAM, LPARAM);
+ afx_msg LRESULT OnExitSizeMove(WPARAM, LPARAM);
+ afx_msg void OnClose();
+ afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
+ afx_msg void OnUpdateMemoryUsage(CCmdUI *pCmdUI);
+ afx_msg void OnSize(UINT nType, int cx, int cy);
+ afx_msg void OnUpdateViewShowtreemap(CCmdUI *pCmdUI);
+ afx_msg void OnViewShowtreemap();
+ afx_msg void OnUpdateViewShowfiletypes(CCmdUI *pCmdUI);
+ afx_msg void OnViewShowfiletypes();
+ afx_msg void OnConfigure();
+ afx_msg void OnDestroy();
+ afx_msg void OnBnClickedSuspend();
+ afx_msg void OnTreemapHelpabouttreemaps();
+#ifdef SUPPORT_W7_TASKBAR
+ afx_msg LRESULT OnTaskButtonCreated(WPARAM, LPARAM);
+#endif // SUPPORT_W7_TASKBAR
+
+public:
+ #ifdef _DEBUG
+ virtual void AssertValid() const;
+ virtual void Dump(CDumpContext& dc) const;
+ #endif
+ afx_msg void OnSysColorChange();
+};
+
+#endif // __WDS_MAINFRAME_H__
diff --git a/windirstat/mountpoints.cpp b/windirstat/mountpoints.cpp
index 63de831..0d934dd 100644
--- a/windirstat/mountpoints.cpp
+++ b/windirstat/mountpoints.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "osspecific.h"
diff --git a/windirstat/mountpoints.h b/windirstat/mountpoints.h
index e4861ed..ec0d829 100644
--- a/windirstat/mountpoints.h
+++ b/windirstat/mountpoints.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_MOUNTPOINTS_H__
#define __WDS_MOUNTPOINTS_H__
diff --git a/windirstat/options.cpp b/windirstat/options.cpp
index 005310a..6bec487 100644
--- a/windirstat/options.cpp
+++ b/windirstat/options.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "windirstat.h"
diff --git a/windirstat/options.h b/windirstat/options.h
index c6bd2f0..fb07371 100644
--- a/windirstat/options.h
+++ b/windirstat/options.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_OPTIONS_H__
#define __WDS_OPTIONS_H__
diff --git a/windirstat/osspecific.cpp b/windirstat/osspecific.cpp
index 71be66a..54b87da 100644
--- a/windirstat/osspecific.cpp
+++ b/windirstat/osspecific.cpp
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
#include "osspecific.h"
diff --git a/windirstat/osspecific.h b/windirstat/osspecific.h
index 1cd2757..25abc28 100644
--- a/windirstat/osspecific.h
+++ b/windirstat/osspecific.h
@@ -18,7 +18,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_OSSPECIFIC_H__
#define __WDS_OSSPECIFIC_H__
diff --git a/windirstat/selectobject.h b/windirstat/selectobject.h
index 8af0505..aadf71a 100644
--- a/windirstat/selectobject.h
+++ b/windirstat/selectobject.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
// Example:
diff --git a/windirstat/set.h b/windirstat/set.h
index 98efcf4..299fe80 100644
--- a/windirstat/set.h
+++ b/windirstat/set.h
@@ -17,7 +17,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_SET_H__
#define __WDS_SET_H__
diff --git a/windirstat/stdafx.cpp b/windirstat/stdafx.cpp
index 7a61c78..098236d 100644
--- a/windirstat/stdafx.cpp
+++ b/windirstat/stdafx.cpp
@@ -19,7 +19,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#include "stdafx.h"
diff --git a/windirstat/stdafx.h b/windirstat/stdafx.h
index ebc8a2d..22c6830 100644
--- a/windirstat/stdafx.h
+++ b/windirstat/stdafx.h
@@ -19,7 +19,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_STDAFX_H__
#define __WDS_STDAFX_H__
diff --git a/windirstat/windirstat.cpp b/windirstat/windirstat.cpp
index b62289c..e05efbf 100644
--- a/windirstat/windirstat.cpp
+++ b/windirstat/windirstat.cpp
@@ -1,783 +1,783 @@
-// windirstat.cpp - Implementation of CDirstatApp and some globals
-//
-// WinDirStat - Directory Statistics
-// Copyright (C) 2003-2005 Bernhard Seifert
-// Copyright (C) 2004-2016 WinDirStat team (windirstat.info)
-// Copyright (C) 2010 Chris Wimmer
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-//
-
-#include "stdafx.h"
-#include "windirstat.h"
-#include "mainframe.h"
-#include "selectdrivesdlg.h"
-#include "aboutdlg.h"
-#include "dirstatdoc.h"
-#include "graphview.h"
-#include "osspecific.h"
-#include "WorkLimiter.h"
-#include <Dbghelp.h> // for mini dumps
-
-#ifdef _DEBUG
-# include <common/tracer.cpp>
-# define new DEBUG_NEW
-#endif
-
-CMainFrame *GetMainFrame()
-{
- // Not: return (CMainFrame *)AfxGetMainWnd();
- // because CWinApp::m_pMainWnd is set too late.
- return CMainFrame::GetTheFrame();
-}
-
-CDirstatApp *GetWDSApp()
-{
- return reinterpret_cast<CDirstatApp *>(AfxGetApp());
-}
-
-CString GetAuthorEmail()
-{
- return _T("team") _T("\x40") _T("windirstat.info"); // FIXME into common string file
-}
-
-CString GetWinDirStatHomepage()
-{
- return _T("windirstat.info"); // FIXME into common string file
-}
-
-CMyImageList* GetMyImageList()
-{
- return GetWDSApp()->GetMyImageList();
-}
-
-
-// CDirstatApp
-
-BEGIN_MESSAGE_MAP(CDirstatApp, CWinApp)
- ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
- ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
-#if SUPPORT_ELEVATION
- ON_COMMAND(ID_RUNELEVATED, OnRunElevated)
- ON_UPDATE_COMMAND_UI(ID_RUNELEVATED, OnUpdateRunElevated)
-#endif // SUPPORT_ELEVATION
- ON_COMMAND(ID_HELP_MANUAL, OnHelpManual)
-END_MESSAGE_MAP()
-
-
-CDirstatApp _theApp;
-
-CDirstatApp::CDirstatApp()
- : Inherited()
- , m_pDocTemplate(0)
- , m_langid(0)
- , m_workingSet(0)
- , m_pageFaults(0)
- , m_lastPeriodicalRamUsageUpdate(::GetTickCount())
- , m_altColor(GetAlternativeColor(RGB(0x00, 0x00, 0xFF), _T("AltColor")))
- , m_altEncryptionColor(GetAlternativeColor(RGB(0x00, 0x80, 0x00), _T("AltEncryptionColor")))
-# if SUPPORT_ELEVATION
- , m_ElevationEvent(NULL)
- , m_ElevationEventName()
-# endif // SUPPORT_ELEVATION
-# ifdef VTRACE_TO_CONSOLE
- , m_vtrace_console(new CWDSTracerConsole())
-# endif // VTRACE_TO_CONSOLE
-{
-# ifdef _DEBUG
- TestScanResourceDllName();
-# endif
-
-# if SUPPORT_ELEVATION
- m_ElevationEventName.Format(WINDIRSTAT_EVENT_NAME_FMT, static_cast<LPCTSTR>(GetCurrentDesktopName()), static_cast<LPCTSTR>(GetCurrentWinstaName()));
- VTRACE(_T("Elevation event: %s"), static_cast<LPCTSTR>(m_ElevationEventName));
-# endif // SUPPORT_ELEVATION
-}
-
-CDirstatApp::~CDirstatApp()
-{
-#if SUPPORT_ELEVATION
- if (m_ElevationEvent)
- {
- CloseHandle(m_ElevationEvent); //make sure this is the very last thing that is destroyed (way after WM_CLOSE)
- }
-#endif // SUPPORT_ELEVATION
-}
-
-CMyImageList* CDirstatApp::GetMyImageList()
-{
- m_myImageList.initialize();
- return &m_myImageList;
-}
-
-void CDirstatApp::UpdateRamUsage()
-{
- CWinThread::OnIdle(0);
-}
-
-void CDirstatApp::PeriodicalUpdateRamUsage()
-{
- if(::GetTickCount() - m_lastPeriodicalRamUsageUpdate > 1200)
- {
- UpdateRamUsage();
- m_lastPeriodicalRamUsageUpdate = ::GetTickCount();
- }
-}
-
-CString CDirstatApp::FindResourceDllPathByLangid(LANGID& langid)
-{
- return FindAuxiliaryFileByLangid(
- wds::strLangPrefix
- , wds::strLangSuffix
- , langid
- , true
- );
-}
-
-CString CDirstatApp::FindHelpfilePathByLangid(LANGID langid)
-{
- CString s;
- if(langid == GetBuiltInLanguage())
- {
- // The English help file is named windirstat.chm.
- s = GetAppFolder() + _T("\\windirstat.chm");
- if(::PathFileExists(s))
- {
- return s;
- }
- }
-
- // Help files for other languages are named wdshxxxx.chm (xxxx = LANGID).
- s = FindAuxiliaryFileByLangid(_T("wdsh"), _T(".chm"), langid, false);
- if(!s.IsEmpty())
- {
- return s;
- }
-
- // Else, try windirstat.chm again.
- s = GetAppFolder() + _T("\\windirstat.chm");
- if(::PathFileExists(s))
- {
- return s;
- }
-
- // Not found.
- return wds::strEmpty;
-}
-
-void CDirstatApp::GetAvailableResourceDllLangids(CArray<LANGID, LANGID>& arr)
-{
- arr.RemoveAll();
-
- CFileFind finder;
- BOOL b = finder.FindFile(GetAppFolder() + _T("\\wdsr*") _T(STR_LANG_SUFFIX));
- while(b)
- {
- b = finder.FindNextFile();
- if(finder.IsDirectory())
- {
- continue;
- }
-
- LANGID langid;
- if(ScanResourceDllName(finder.GetFileName(), langid) && IsCorrectResourceDll(finder.GetFilePath()))
- {
- arr.Add(langid);
- }
- }
-}
-
-void CDirstatApp::RestartApplication()
-{
- // First, try to create the suspended process
- STARTUPINFO si;
- ZeroMemory(&si, sizeof(si));
- si.cb = sizeof(si);
-
- PROCESS_INFORMATION pi;
- ZeroMemory(&pi, sizeof(pi));
-
- BOOL success = CreateProcess(GetAppFileName(), NULL, NULL, NULL, false, CREATE_SUSPENDED, NULL, NULL, &si, &pi);
- if(!success)
- {
- CString s;
- s.FormatMessage(IDS_CREATEPROCESSsFAILEDs, GetAppFileName(), MdGetWinErrorText(::GetLastError()));
- AfxMessageBox(s);
- return;
- }
-
- // We _send_ the WM_CLOSE here to ensure that all CPersistence-Settings
- // like column widths an so on are saved before the new instance is resumed.
- // This will post a WM_QUIT message.
- GetMainFrame()->SendMessage(WM_CLOSE);
-
- DWORD dw = ::ResumeThread(pi.hThread);
- if(dw != 1)
- {
- VTRACE(_T("ResumeThread() didn't return 1"));
- }
-
- ::CloseHandle(pi.hProcess);
- ::CloseHandle(pi.hThread);
-}
-
-bool CDirstatApp::getDiskFreeSpace(LPCTSTR pszRootPath, ULONGLONG& total, ULONGLONG& unused)
-{
- static ULARGE_INTEGER u64available = {0};
- ULARGE_INTEGER u64total = {0};
- ULARGE_INTEGER u64free = {0};
-
- // On NT 4.0, the 2nd Parameter to this function must NOT be NULL.
- // TODO: verify whether Windows 2000 behaves correctly
- BOOL b = GetDiskFreeSpaceEx(pszRootPath, &u64available, &u64total, &u64free);
- if(!b)
- {
- VTRACE(_T("GetDiskFreeSpaceEx(%s) failed."), pszRootPath);
- }
-
- // FIXME: need to retrieve total via IOCTL_DISK_GET_PARTITION_INFO instead
- total = u64total.QuadPart;
- unused = u64free.QuadPart;
-
- // Race condition ...
- ASSERT(unused <= total);
- return (FALSE != b);
-}
-
-bool CDirstatApp::ScanResourceDllName(LPCTSTR name, LANGID& langid)
-{
- return ScanAuxiliaryFileName(
- wds::strLangPrefix
- , wds::strLangSuffix
- , name
- , langid
- );
-}
-
-// suffix contains the dot (e.g. ".chm")
-bool CDirstatApp::ScanAuxiliaryFileName(LPCTSTR prefix, LPCTSTR suffix, LPCTSTR name, LANGID& langid)
-{
- using wds::iLangCodeLength;
- ASSERT(_tcslen(prefix) == _tcslen(wds::strLangPrefix)); // FIXME: Also add .chm part or split
- ASSERT(_tcslen(suffix) == _tcslen(wds::strLangSuffix)); // FIXME: see above
-
- CString s(name); // [prefix][lngcode].[suffix]
- s.MakeLower();
- if(s.Left(((int)_tcslen(prefix))) != prefix)
- {
- return false;
- }
- s = s.Mid(((int)_tcslen(prefix))); // remove prefix from the front -> [lngcode].[suffix]
-
- if(s.GetLength() != (iLangCodeLength + ((int)_tcslen(suffix))))
- {
- return false;
- }
-
- if(s.Mid(iLangCodeLength) != CString(suffix).MakeLower())
- {
- return false;
- }
-
- s = s.Left(iLangCodeLength); // retain the language code -> [lngcode]
-
- for(int i = 0; i < iLangCodeLength; i++)
- {
- if(!_istxdigit(s[i]))
- {
- return false;
- }
- }
-
- int id;
- VERIFY(1 == _stscanf_s(s, _T("%04x"), &id));
- langid = (LANGID)id;
-
- return true;
-}
-
-#ifdef _DEBUG
-void CDirstatApp::TestScanResourceDllName()
-{
- LANGID id;
- ASSERT(!ScanResourceDllName(wds::strEmpty, id));
- ASSERT(!ScanResourceDllName(_T(STR_RESOURCE_PREFIX) _T(STR_LANG_SUFFIX), id));
- ASSERT(!ScanResourceDllName(_T(STR_RESOURCE_PREFIX) _T("123") _T(STR_LANG_SUFFIX), id));
- ASSERT(!ScanResourceDllName(_T(STR_RESOURCE_PREFIX) _T("12345") _T(STR_LANG_SUFFIX), id));
- ASSERT(!ScanResourceDllName(_T(STR_RESOURCE_PREFIX) _T("1234.exe"), id));
- ASSERT(ScanResourceDllName (_T(STR_RESOURCE_PREFIX) _T("0123") _T(STR_LANG_SUFFIX), id));
- ASSERT(id == 0x0123);
- ASSERT(ScanResourceDllName (CString(_T(STR_RESOURCE_PREFIX) _T("a13F") _T(STR_LANG_SUFFIX)).MakeUpper(), id));
- ASSERT(id == 0xa13f);
-}
-#endif
-
-CString CDirstatApp::FindAuxiliaryFileByLangid(LPCTSTR prefix, LPCTSTR suffix, LANGID& langid, bool checkResource)
-{
- CString number;
- number.Format(_T("%04x"), langid);
-
- CString exactName;
- exactName.Format(_T("%s%s%s"), prefix, number, suffix);
-
- CString exactPath = GetAppFolder() + _T("\\") + exactName;
- if(::PathFileExists(exactPath) && (!checkResource || IsCorrectResourceDll(exactPath)))
- {
- return exactPath;
- }
-
- CString search;
- search.Format(_T("%s*%s"), prefix, suffix);
-
- CFileFind finder;
- BOOL b = finder.FindFile(GetAppFolder() + _T("\\") + search);
- while(b)
- {
- b = finder.FindNextFile();
- if(finder.IsDirectory())
- {
- continue;
- }
-
- LANGID id;
- if(!ScanAuxiliaryFileName(prefix, suffix, finder.GetFileName(), id))
- {
- continue;
- }
-
- if(PRIMARYLANGID(id) == PRIMARYLANGID(langid) && (!checkResource || IsCorrectResourceDll(finder.GetFilePath())))
- {
- langid = id;
- return finder.GetFilePath();
- }
- }
-
- return wds::strEmpty;
-}
-
-CString CDirstatApp::ConstructHelpFileName()
-{
- return FindHelpfilePathByLangid(CLanguageOptions::GetLanguage());
-}
-
-bool CDirstatApp::IsCorrectResourceDll(LPCTSTR path)
-{
- HMODULE module = ::LoadLibraryEx(path, NULL, LOAD_LIBRARY_AS_DATAFILE);
- if(module == NULL)
- {
- return false;
- }
-
- // TODO: introduce some method of checking the resource version
-
- CString reference = LoadString(IDS_RESOURCEVERSION);
-
- int bufsize = reference.GetLength() * 2;
- CString s;
- int r = LoadString(module, IDS_RESOURCEVERSION, s.GetBuffer(bufsize), bufsize);
- s.ReleaseBuffer();
-
- FreeLibrary(module);
-
- if(r == 0 || s != reference)
- {
- return false;
- }
-
- return true;
-}
-
-void CDirstatApp::ReReadMountPoints()
-{
- m_mountPoints.Initialize();
-}
-
-bool CDirstatApp::IsVolumeMountPoint(CString path)
-{
- return m_mountPoints.IsVolumeMountPoint(path);
-}
-
-bool CDirstatApp::IsFolderJunction(CString path)
-{
- return m_mountPoints.IsFolderJunction(path);
-}
-
-// Get the alternative colors for compressed and encrypted files/folders.
-// This function uses either the value defined in the Explorer configuration
-// or the default color values.
-COLORREF CDirstatApp::GetAlternativeColor(COLORREF clrDefault, LPCTSTR which)
-{
- COLORREF x; DWORD cbValue = sizeof(x); CRegKey key;
-
- // Open the explorer key
- key.Open(HKEY_CURRENT_USER, wds::strExplorerKey, KEY_READ);
-
- // Try to read the REG_BINARY value
- if(ERROR_SUCCESS == key.QueryBinaryValue(which, &x, &cbValue))
- {
- // Return the read value upon success
- return x;
- }
- else
- {
- // Return the default upon failure
- return clrDefault;
- }
-}
-
-COLORREF CDirstatApp::AltColor()
-{
- // Return property value
- return m_altColor;
-}
-
-COLORREF CDirstatApp::AltEncryptionColor()
-{
- // Return property value
- return m_altEncryptionColor;
-}
-
-CString CDirstatApp::GetCurrentProcessMemoryInfo()
-{
- UpdateMemoryInfo();
-
- if(m_workingSet == 0)
- {
- return wds::strEmpty;
- }
-
- CString n = PadWidthBlanks(FormatBytes(m_workingSet), 11);
-
- CString s;
- s.FormatMessage(IDS_RAMUSAGEs, n);
-
- return s;
-}
-
-bool CDirstatApp::UpdateMemoryInfo()
-{
- PROCESS_MEMORY_COUNTERS pmc;
- ZeroMemory(&pmc, sizeof(pmc));
- pmc.cb = sizeof(pmc);
-
- if(!::GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc)))
- {
- return false;
- }
-
- m_workingSet = pmc.WorkingSetSize;
-
- bool ret = false;
- if(pmc.PageFaultCount > m_pageFaults + 500)
- {
- ret = true;
- }
-
- m_pageFaults = pmc.PageFaultCount;
-
- return ret;
-}
-
-LANGID CDirstatApp::GetBuiltInLanguage()
-{
- return MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US);
-}
-
-BOOL CDirstatApp::InitInstance()
-{
- Inherited::InitInstance();
-
- ::InitCommonControls(); // InitCommonControls() is necessary for Windows XP.
- VERIFY(AfxOleInit()); // For ::SHBrowseForFolder()
- AfxEnableControlContainer(); // For our rich edit controls in the about dialog
- VERIFY(AfxInitRichEdit()); // Rich edit control in out about box
- VERIFY(AfxInitRichEdit2()); // On NT, this helps.
- Inherited::EnableHtmlHelp();
-
- Inherited::SetRegistryKey(_T("Seifert"));
- Inherited::LoadStdProfileSettings(4);
-
- m_langid = GetBuiltInLanguage();
-
- LANGID langid = CLanguageOptions::GetLanguage();
- if(langid != GetBuiltInLanguage())
- {
- CString resourceDllPath = FindResourceDllPathByLangid(langid);
- if(!resourceDllPath.IsEmpty())
- {
- // Load language resource DLL
- HINSTANCE dll = ::LoadLibrary(resourceDllPath);
- if(dll)
- {
- // Set default module handle for loading of resources
- AfxSetResourceHandle(dll);
- m_langid = langid;
- }
- else
- {
- VTRACE(_T("LoadLibrary(%s) failed: %u"), resourceDllPath, ::GetLastError());
- }
- }
- // else: We use our built-in English resources.
-
- CLanguageOptions::SetLanguage(m_langid);
- }
-
-#if SUPPORT_ELEVATION
- //check for an elevation event
- m_ElevationEvent = ::OpenEvent(SYNCHRONIZE, FALSE, m_ElevationEventName);
-
- if (m_ElevationEvent)
- {
- //and if so, wait for it, so previous instance can store its config that we reload next
- ::WaitForSingleObject(m_ElevationEvent, 20 * 1000);
- ::CloseHandle(m_ElevationEvent);
- m_ElevationEvent = 0;
- }
-#endif // SUPPORT_ELEVATION
-
- GetOptions()->LoadFromRegistry();
-
- free((void*)m_pszHelpFilePath);
- m_pszHelpFilePath = _tcsdup(ConstructHelpFileName()); // ~CWinApp() will free this memory.
-
- m_pDocTemplate = new CSingleDocTemplate(
- IDR_MAINFRAME,
- RUNTIME_CLASS(CDirstatDoc),
- RUNTIME_CLASS(CMainFrame),
- RUNTIME_CLASS(CGraphView));
- if(!m_pDocTemplate)
- {
- return FALSE;
- }
- AddDocTemplate(m_pDocTemplate);
-
- CCommandLineInfo cmdInfo;
- ParseCommandLine(cmdInfo);
-
- m_nCmdShow = SW_HIDE;
- if(!ProcessShellCommand(cmdInfo))
- {
- return FALSE;
- }
- FileIconInit(TRUE);
-
- GetMainFrame()->InitialShowWindow();
- m_pMainWnd->UpdateWindow();
-
- // When called by setup.exe, WinDirStat remained in the
- // background, so we do a
- m_pMainWnd->BringWindowToTop();
- m_pMainWnd->SetForegroundWindow();
-
- if(cmdInfo.m_nShellCommand != CCommandLineInfo::FileOpen)
- {
- OnFileOpen();
- }
-
- return TRUE;
-}
-
-int CDirstatApp::ExitInstance()
-{
- return Inherited::ExitInstance();
-}
-
-LANGID CDirstatApp::GetLangid()
-{
- return m_langid;
-}
-
-LANGID CDirstatApp::GetEffectiveLangid()
-{
- if(GetOptions()->IsUseWdsLocale())
- {
- return GetLangid();
- }
- else
- {
- return ::GetUserDefaultLangID();
- }
-}
-
-void CDirstatApp::OnAppAbout()
-{
- StartAboutDialog();
-}
-
-void CDirstatApp::OnFileOpen()
-{
- CSelectDrivesDlg dlg;
- if(IDOK == dlg.DoModal())
- {
- CString path = CDirstatDoc::EncodeSelection((RADIO)dlg.m_radio, dlg.m_folderName, dlg.m_drives);
- m_pDocTemplate->OpenDocumentFile(path, true);
- }
-}
-
-#if SUPPORT_ELEVATION
-BOOL CDirstatApp::IsUACEnabled()
-{
- OSVERSIONINFOEX osInfo;
- DWORDLONG conditionMask = 0;
-
- ZeroMemory(&osInfo, sizeof(osInfo));
- osInfo.dwOSVersionInfoSize = sizeof(osInfo);
- osInfo.dwMajorVersion = 6;
- osInfo.dwMinorVersion = 0;
- VER_SET_CONDITION(conditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
- VER_SET_CONDITION(conditionMask, VER_MINORVERSION, VER_GREATER_EQUAL);
-
- if (::VerifyVersionInfo(&osInfo, VER_MAJORVERSION | VER_MINORVERSION, conditionMask))
- {
- HKEY hKey;
- if (::RegOpenKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", &hKey) == ERROR_SUCCESS)
- {
- DWORD value = 0;
- if (::RegQueryValueExW(hKey, L"EnableLUA", NULL, NULL, NULL, &value) == ERROR_SUCCESS)
- {
- return (value != 0);
- }
- else
- {
- VTRACE(_T("IsUACEnabled::RegQueryValueExW failed"));
- }
-
- ::RegCloseKey(hKey);
- }
- else
- {
- VTRACE(_T("IsUACEnabled::RegOpenKeyW failed"));
- }
- }
-
- return FALSE;
-}
-
-void CDirstatApp::OnUpdateRunElevated(CCmdUI *pCmdUI)
-{
- pCmdUI->Enable(!IsAdmin() && IsUACEnabled());
-}
-
-#ifndef SEE_MASK_DEFAULT
-# define SEE_MASK_DEFAULT 0x00000000
-#endif
-
-void CDirstatApp::OnRunElevated()
-{
- if (IsAdmin() || !IsUACEnabled())
- return;
-
- CString sAppName = GetAppFileName();
-
- SHELLEXECUTEINFO shellInfo;
- ZeroMemory(&shellInfo, sizeof(shellInfo));
- shellInfo.cbSize = sizeof(shellInfo);
- shellInfo.fMask = SEE_MASK_DEFAULT;
- shellInfo.lpFile = sAppName;
- shellInfo.lpVerb = L"runas"; //DO NOT LOCALIZE
- shellInfo.nShow = SW_NORMAL;
-
-
- if (m_ElevationEvent)
- {
- ::CloseHandle(m_ElevationEvent);
- }
- m_ElevationEvent = ::CreateEvent(NULL, TRUE, FALSE, m_ElevationEventName);
- if (!m_ElevationEvent)
- {
- VTRACE(_T("CreateEvent failed: %d"), GetLastError());
- m_ElevationEvent = 0;
- return;
- }
- if (ERROR_ALREADY_EXISTS == ::GetLastError())
- {
- VTRACE(_T("Event already exists"));
- ::CloseHandle(m_ElevationEvent);
- m_ElevationEvent = 0;
- return;
- }
-
- if (!::ShellExecuteEx(&shellInfo))
- {
- VTRACE(_T("ShellExecuteEx failed to elevate %d"), GetLastError());
-
- ::CloseHandle(m_ElevationEvent);
- m_ElevationEvent = 0;
-
- //TODO: Display message to user?
- }
- else
- {
- //TODO: Store configurations for the new app
-
- GetMainFrame()->SendMessage(WM_CLOSE);
- ::SetEvent(m_ElevationEvent); //Tell other process that we finished saving data (it waits only 20s)
-
- ::CloseHandle(m_ElevationEvent);
- m_ElevationEvent = 0;
- }
-}
-#endif // SUPPORT_ELEVATION
-
-BOOL CDirstatApp::OnIdle(LONG lCount)
-{
- bool more = false;
-
- CDirstatDoc *doc = GetDocument();
- CWorkLimiter limiter;
- limiter.Start(600);
- if((doc) && (!doc->Work(&limiter)))
- {
- more = true;
- }
-
- if(Inherited::OnIdle(lCount))
- {
- more = true;
- }
-
- // The status bar (RAM usage) is updated only when count == 0.
- // That's why we call an extra OnIdle(0) here.
- if(CWinThread::OnIdle(0))
- {
- more = true;
- }
-
- return more;
-}
-
-void CDirstatApp::OnHelpManual()
-{
- DoContextHelp(IDH_StartPage);
-}
-
-void CDirstatApp::DoContextHelp(DWORD topic)
-{
- if(::PathFileExists(m_pszHelpFilePath))
- {
- // I want a NULL parent window. So I don't use CWinApp::HtmlHelp().
- ::HtmlHelp(NULL, m_pszHelpFilePath, HH_HELP_CONTEXT, topic);
- }
- else
- {
- CString msg;
- msg.FormatMessage(IDS_HELPFILEsCOULDNOTBEFOUND, _T("windirstat.chm"));
- // TODO: Add the option to download the "current language" help file ...
- AfxMessageBox(msg);
- }
-}
-
+// windirstat.cpp - Implementation of CDirstatApp and some globals
+//
+// WinDirStat - Directory Statistics
+// Copyright (C) 2003-2005 Bernhard Seifert
+// Copyright (C) 2004-2016 WinDirStat team (windirstat.info)
+// Copyright (C) 2010 Chris Wimmer
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+//
+
+#include "stdafx.h"
+#include "windirstat.h"
+#include "mainframe.h"
+#include "selectdrivesdlg.h"
+#include "aboutdlg.h"
+#include "dirstatdoc.h"
+#include "graphview.h"
+#include "osspecific.h"
+#include "WorkLimiter.h"
+#include <Dbghelp.h> // for mini dumps
+
+#ifdef _DEBUG
+# include <common/tracer.cpp>
+# define new DEBUG_NEW
+#endif
+
+CMainFrame *GetMainFrame()
+{
+ // Not: return (CMainFrame *)AfxGetMainWnd();
+ // because CWinApp::m_pMainWnd is set too late.
+ return CMainFrame::GetTheFrame();
+}
+
+CDirstatApp *GetWDSApp()
+{
+ return reinterpret_cast<CDirstatApp *>(AfxGetApp());
+}
+
+CString GetAuthorEmail()
+{
+ return _T("team") _T("\x40") _T("windirstat.info"); // FIXME into common string file
+}
+
+CString GetWinDirStatHomepage()
+{
+ return _T("windirstat.info"); // FIXME into common string file
+}
+
+CMyImageList* GetMyImageList()
+{
+ return GetWDSApp()->GetMyImageList();
+}
+
+
+// CDirstatApp
+
+BEGIN_MESSAGE_MAP(CDirstatApp, CWinApp)
+ ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
+ ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
+#if SUPPORT_ELEVATION
+ ON_COMMAND(ID_RUNELEVATED, OnRunElevated)
+ ON_UPDATE_COMMAND_UI(ID_RUNELEVATED, OnUpdateRunElevated)
+#endif // SUPPORT_ELEVATION
+ ON_COMMAND(ID_HELP_MANUAL, OnHelpManual)
+END_MESSAGE_MAP()
+
+
+CDirstatApp _theApp;
+
+CDirstatApp::CDirstatApp()
+ : Inherited()
+ , m_pDocTemplate(0)
+ , m_langid(0)
+ , m_workingSet(0)
+ , m_pageFaults(0)
+ , m_lastPeriodicalRamUsageUpdate(::GetTickCount())
+ , m_altColor(GetAlternativeColor(RGB(0x00, 0x00, 0xFF), _T("AltColor")))
+ , m_altEncryptionColor(GetAlternativeColor(RGB(0x00, 0x80, 0x00), _T("AltEncryptionColor")))
+# if SUPPORT_ELEVATION
+ , m_ElevationEvent(NULL)
+ , m_ElevationEventName()
+# endif // SUPPORT_ELEVATION
+# ifdef VTRACE_TO_CONSOLE
+ , m_vtrace_console(new CWDSTracerConsole())
+# endif // VTRACE_TO_CONSOLE
+{
+# ifdef _DEBUG
+ TestScanResourceDllName();
+# endif
+
+# if SUPPORT_ELEVATION
+ m_ElevationEventName.Format(WINDIRSTAT_EVENT_NAME_FMT, static_cast<LPCTSTR>(GetCurrentDesktopName()), static_cast<LPCTSTR>(GetCurrentWinstaName()));
+ VTRACE(_T("Elevation event: %s"), static_cast<LPCTSTR>(m_ElevationEventName));
+# endif // SUPPORT_ELEVATION
+}
+
+CDirstatApp::~CDirstatApp()
+{
+#if SUPPORT_ELEVATION
+ if (m_ElevationEvent)
+ {
+ CloseHandle(m_ElevationEvent); //make sure this is the very last thing that is destroyed (way after WM_CLOSE)
+ }
+#endif // SUPPORT_ELEVATION
+}
+
+CMyImageList* CDirstatApp::GetMyImageList()
+{
+ m_myImageList.initialize();
+ return &m_myImageList;
+}
+
+void CDirstatApp::UpdateRamUsage()
+{
+ CWinThread::OnIdle(0);
+}
+
+void CDirstatApp::PeriodicalUpdateRamUsage()
+{
+ if(::GetTickCount() - m_lastPeriodicalRamUsageUpdate > 1200)
+ {
+ UpdateRamUsage();
+ m_lastPeriodicalRamUsageUpdate = ::GetTickCount();
+ }
+}
+
+CString CDirstatApp::FindResourceDllPathByLangid(LANGID& langid)
+{
+ return FindAuxiliaryFileByLangid(
+ wds::strLangPrefix
+ , wds::strLangSuffix
+ , langid
+ , true
+ );
+}
+
+CString CDirstatApp::FindHelpfilePathByLangid(LANGID langid)
+{
+ CString s;
+ if(langid == GetBuiltInLanguage())
+ {
+ // The English help file is named windirstat.chm.
+ s = GetAppFolder() + _T("\\windirstat.chm");
+ if(::PathFileExists(s))
+ {
+ return s;
+ }
+ }
+
+ // Help files for other languages are named wdshxxxx.chm (xxxx = LANGID).
+ s = FindAuxiliaryFileByLangid(_T("wdsh"), _T(".chm"), langid, false);
+ if(!s.IsEmpty())
+ {
+ return s;
+ }
+
+ // Else, try windirstat.chm again.
+ s = GetAppFolder() + _T("\\windirstat.chm");
+ if(::PathFileExists(s))
+ {
+ return s;
+ }
+
+ // Not found.
+ return wds::strEmpty;
+}
+
+void CDirstatApp::GetAvailableResourceDllLangids(CArray<LANGID, LANGID>& arr)
+{
+ arr.RemoveAll();
+
+ CFileFind finder;
+ BOOL b = finder.FindFile(GetAppFolder() + _T("\\wdsr*") _T(STR_LANG_SUFFIX));
+ while(b)
+ {
+ b = finder.FindNextFile();
+ if(finder.IsDirectory())
+ {
+ continue;
+ }
+
+ LANGID langid;
+ if(ScanResourceDllName(finder.GetFileName(), langid) && IsCorrectResourceDll(finder.GetFilePath()))
+ {
+ arr.Add(langid);
+ }
+ }
+}
+
+void CDirstatApp::RestartApplication()
+{
+ // First, try to create the suspended process
+ STARTUPINFO si;
+ ZeroMemory(&si, sizeof(si));
+ si.cb = sizeof(si);
+
+ PROCESS_INFORMATION pi;
+ ZeroMemory(&pi, sizeof(pi));
+
+ BOOL success = CreateProcess(GetAppFileName(), NULL, NULL, NULL, false, CREATE_SUSPENDED, NULL, NULL, &si, &pi);
+ if(!success)
+ {
+ CString s;
+ s.FormatMessage(IDS_CREATEPROCESSsFAILEDs, GetAppFileName(), MdGetWinErrorText(::GetLastError()));
+ AfxMessageBox(s);
+ return;
+ }
+
+ // We _send_ the WM_CLOSE here to ensure that all CPersistence-Settings
+ // like column widths an so on are saved before the new instance is resumed.
+ // This will post a WM_QUIT message.
+ GetMainFrame()->SendMessage(WM_CLOSE);
+
+ DWORD dw = ::ResumeThread(pi.hThread);
+ if(dw != 1)
+ {
+ VTRACE(_T("ResumeThread() didn't return 1"));
+ }
+
+ ::CloseHandle(pi.hProcess);
+ ::CloseHandle(pi.hThread);
+}
+
+bool CDirstatApp::getDiskFreeSpace(LPCTSTR pszRootPath, ULONGLONG& total, ULONGLONG& unused)
+{
+ static ULARGE_INTEGER u64available = {0};
+ ULARGE_INTEGER u64total = {0};
+ ULARGE_INTEGER u64free = {0};
+
+ // On NT 4.0, the 2nd Parameter to this function must NOT be NULL.
+ // TODO: verify whether Windows 2000 behaves correctly
+ BOOL b = GetDiskFreeSpaceEx(pszRootPath, &u64available, &u64total, &u64free);
+ if(!b)
+ {
+ VTRACE(_T("GetDiskFreeSpaceEx(%s) failed."), pszRootPath);
+ }
+
+ // FIXME: need to retrieve total via IOCTL_DISK_GET_PARTITION_INFO instead
+ total = u64total.QuadPart;
+ unused = u64free.QuadPart;
+
+ // Race condition ...
+ ASSERT(unused <= total);
+ return (FALSE != b);
+}
+
+bool CDirstatApp::ScanResourceDllName(LPCTSTR name, LANGID& langid)
+{
+ return ScanAuxiliaryFileName(
+ wds::strLangPrefix
+ , wds::strLangSuffix
+ , name
+ , langid
+ );
+}
+
+// suffix contains the dot (e.g. ".chm")
+bool CDirstatApp::ScanAuxiliaryFileName(LPCTSTR prefix, LPCTSTR suffix, LPCTSTR name, LANGID& langid)
+{
+ using wds::iLangCodeLength;
+ ASSERT(_tcslen(prefix) == _tcslen(wds::strLangPrefix)); // FIXME: Also add .chm part or split
+ ASSERT(_tcslen(suffix) == _tcslen(wds::strLangSuffix)); // FIXME: see above
+
+ CString s(name); // [prefix][lngcode].[suffix]
+ s.MakeLower();
+ if(s.Left(((int)_tcslen(prefix))) != prefix)
+ {
+ return false;
+ }
+ s = s.Mid(((int)_tcslen(prefix))); // remove prefix from the front -> [lngcode].[suffix]
+
+ if(s.GetLength() != (iLangCodeLength + ((int)_tcslen(suffix))))
+ {
+ return false;
+ }
+
+ if(s.Mid(iLangCodeLength) != CString(suffix).MakeLower())
+ {
+ return false;
+ }
+
+ s = s.Left(iLangCodeLength); // retain the language code -> [lngcode]
+
+ for(int i = 0; i < iLangCodeLength; i++)
+ {
+ if(!_istxdigit(s[i]))
+ {
+ return false;
+ }
+ }
+
+ int id;
+ VERIFY(1 == _stscanf_s(s, _T("%04x"), &id));
+ langid = (LANGID)id;
+
+ return true;
+}
+
+#ifdef _DEBUG
+void CDirstatApp::TestScanResourceDllName()
+{
+ LANGID id;
+ ASSERT(!ScanResourceDllName(wds::strEmpty, id));
+ ASSERT(!ScanResourceDllName(_T(STR_RESOURCE_PREFIX) _T(STR_LANG_SUFFIX), id));
+ ASSERT(!ScanResourceDllName(_T(STR_RESOURCE_PREFIX) _T("123") _T(STR_LANG_SUFFIX), id));
+ ASSERT(!ScanResourceDllName(_T(STR_RESOURCE_PREFIX) _T("12345") _T(STR_LANG_SUFFIX), id));
+ ASSERT(!ScanResourceDllName(_T(STR_RESOURCE_PREFIX) _T("1234.exe"), id));
+ ASSERT(ScanResourceDllName (_T(STR_RESOURCE_PREFIX) _T("0123") _T(STR_LANG_SUFFIX), id));
+ ASSERT(id == 0x0123);
+ ASSERT(ScanResourceDllName (CString(_T(STR_RESOURCE_PREFIX) _T("a13F") _T(STR_LANG_SUFFIX)).MakeUpper(), id));
+ ASSERT(id == 0xa13f);
+}
+#endif
+
+CString CDirstatApp::FindAuxiliaryFileByLangid(LPCTSTR prefix, LPCTSTR suffix, LANGID& langid, bool checkResource)
+{
+ CString number;
+ number.Format(_T("%04x"), langid);
+
+ CString exactName;
+ exactName.Format(_T("%s%s%s"), prefix, number, suffix);
+
+ CString exactPath = GetAppFolder() + _T("\\") + exactName;
+ if(::PathFileExists(exactPath) && (!checkResource || IsCorrectResourceDll(exactPath)))
+ {
+ return exactPath;
+ }
+
+ CString search;
+ search.Format(_T("%s*%s"), prefix, suffix);
+
+ CFileFind finder;
+ BOOL b = finder.FindFile(GetAppFolder() + _T("\\") + search);
+ while(b)
+ {
+ b = finder.FindNextFile();
+ if(finder.IsDirectory())
+ {
+ continue;
+ }
+
+ LANGID id;
+ if(!ScanAuxiliaryFileName(prefix, suffix, finder.GetFileName(), id))
+ {
+ continue;
+ }
+
+ if(PRIMARYLANGID(id) == PRIMARYLANGID(langid) && (!checkResource || IsCorrectResourceDll(finder.GetFilePath())))
+ {
+ langid = id;
+ return finder.GetFilePath();
+ }
+ }
+
+ return wds::strEmpty;
+}
+
+CString CDirstatApp::ConstructHelpFileName()
+{
+ return FindHelpfilePathByLangid(CLanguageOptions::GetLanguage());
+}
+
+bool CDirstatApp::IsCorrectResourceDll(LPCTSTR path)
+{
+ HMODULE module = ::LoadLibraryEx(path, NULL, LOAD_LIBRARY_AS_DATAFILE);
+ if(module == NULL)
+ {
+ return false;
+ }
+
+ // TODO: introduce some method of checking the resource version
+
+ CString reference = LoadString(IDS_RESOURCEVERSION);
+
+ int bufsize = reference.GetLength() * 2;
+ CString s;
+ int r = LoadString(module, IDS_RESOURCEVERSION, s.GetBuffer(bufsize), bufsize);
+ s.ReleaseBuffer();
+
+ FreeLibrary(module);
+
+ if(r == 0 || s != reference)
+ {
+ return false;
+ }
+
+ return true;
+}
+
+void CDirstatApp::ReReadMountPoints()
+{
+ m_mountPoints.Initialize();
+}
+
+bool CDirstatApp::IsVolumeMountPoint(CString path)
+{
+ return m_mountPoints.IsVolumeMountPoint(path);
+}
+
+bool CDirstatApp::IsFolderJunction(CString path)
+{
+ return m_mountPoints.IsFolderJunction(path);
+}
+
+// Get the alternative colors for compressed and encrypted files/folders.
+// This function uses either the value defined in the Explorer configuration
+// or the default color values.
+COLORREF CDirstatApp::GetAlternativeColor(COLORREF clrDefault, LPCTSTR which)
+{
+ COLORREF x; DWORD cbValue = sizeof(x); CRegKey key;
+
+ // Open the explorer key
+ key.Open(HKEY_CURRENT_USER, wds::strExplorerKey, KEY_READ);
+
+ // Try to read the REG_BINARY value
+ if(ERROR_SUCCESS == key.QueryBinaryValue(which, &x, &cbValue))
+ {
+ // Return the read value upon success
+ return x;
+ }
+ else
+ {
+ // Return the default upon failure
+ return clrDefault;
+ }
+}
+
+COLORREF CDirstatApp::AltColor()
+{
+ // Return property value
+ return m_altColor;
+}
+
+COLORREF CDirstatApp::AltEncryptionColor()
+{
+ // Return property value
+ return m_altEncryptionColor;
+}
+
+CString CDirstatApp::GetCurrentProcessMemoryInfo()
+{
+ UpdateMemoryInfo();
+
+ if(m_workingSet == 0)
+ {
+ return wds::strEmpty;
+ }
+
+ CString n = PadWidthBlanks(FormatBytes(m_workingSet), 11);
+
+ CString s;
+ s.FormatMessage(IDS_RAMUSAGEs, n);
+
+ return s;
+}
+
+bool CDirstatApp::UpdateMemoryInfo()
+{
+ PROCESS_MEMORY_COUNTERS pmc;
+ ZeroMemory(&pmc, sizeof(pmc));
+ pmc.cb = sizeof(pmc);
+
+ if(!::GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc)))
+ {
+ return false;
+ }
+
+ m_workingSet = pmc.WorkingSetSize;
+
+ bool ret = false;
+ if(pmc.PageFaultCount > m_pageFaults + 500)
+ {
+ ret = true;
+ }
+
+ m_pageFaults = pmc.PageFaultCount;
+
+ return ret;
+}
+
+LANGID CDirstatApp::GetBuiltInLanguage()
+{
+ return MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US);
+}
+
+BOOL CDirstatApp::InitInstance()
+{
+ Inherited::InitInstance();
+
+ ::InitCommonControls(); // InitCommonControls() is necessary for Windows XP.
+ VERIFY(AfxOleInit()); // For ::SHBrowseForFolder()
+ AfxEnableControlContainer(); // For our rich edit controls in the about dialog
+ VERIFY(AfxInitRichEdit()); // Rich edit control in out about box
+ VERIFY(AfxInitRichEdit2()); // On NT, this helps.
+ Inherited::EnableHtmlHelp();
+
+ Inherited::SetRegistryKey(_T("Seifert"));
+ Inherited::LoadStdProfileSettings(4);
+
+ m_langid = GetBuiltInLanguage();
+
+ LANGID langid = CLanguageOptions::GetLanguage();
+ if(langid != GetBuiltInLanguage())
+ {
+ CString resourceDllPath = FindResourceDllPathByLangid(langid);
+ if(!resourceDllPath.IsEmpty())
+ {
+ // Load language resource DLL
+ HINSTANCE dll = ::LoadLibrary(resourceDllPath);
+ if(dll)
+ {
+ // Set default module handle for loading of resources
+ AfxSetResourceHandle(dll);
+ m_langid = langid;
+ }
+ else
+ {
+ VTRACE(_T("LoadLibrary(%s) failed: %u"), resourceDllPath, ::GetLastError());
+ }
+ }
+ // else: We use our built-in English resources.
+
+ CLanguageOptions::SetLanguage(m_langid);
+ }
+
+#if SUPPORT_ELEVATION
+ //check for an elevation event
+ m_ElevationEvent = ::OpenEvent(SYNCHRONIZE, FALSE, m_ElevationEventName);
+
+ if (m_ElevationEvent)
+ {
+ //and if so, wait for it, so previous instance can store its config that we reload next
+ ::WaitForSingleObject(m_ElevationEvent, 20 * 1000);
+ ::CloseHandle(m_ElevationEvent);
+ m_ElevationEvent = 0;
+ }
+#endif // SUPPORT_ELEVATION
+
+ GetOptions()->LoadFromRegistry();
+
+ free((void*)m_pszHelpFilePath);
+ m_pszHelpFilePath = _tcsdup(ConstructHelpFileName()); // ~CWinApp() will free this memory.
+
+ m_pDocTemplate = new CSingleDocTemplate(
+ IDR_MAINFRAME,
+ RUNTIME_CLASS(CDirstatDoc),
+ RUNTIME_CLASS(CMainFrame),
+ RUNTIME_CLASS(CGraphView));
+ if(!m_pDocTemplate)
+ {
+ return FALSE;
+ }
+ AddDocTemplate(m_pDocTemplate);
+
+ CCommandLineInfo cmdInfo;
+ ParseCommandLine(cmdInfo);
+
+ m_nCmdShow = SW_HIDE;
+ if(!ProcessShellCommand(cmdInfo))
+ {
+ return FALSE;
+ }
+ FileIconInit(TRUE);
+
+ GetMainFrame()->InitialShowWindow();
+ m_pMainWnd->UpdateWindow();
+
+ // When called by setup.exe, WinDirStat remained in the
+ // background, so we do a
+ m_pMainWnd->BringWindowToTop();
+ m_pMainWnd->SetForegroundWindow();
+
+ if(cmdInfo.m_nShellCommand != CCommandLineInfo::FileOpen)
+ {
+ OnFileOpen();
+ }
+
+ return TRUE;
+}
+
+int CDirstatApp::ExitInstance()
+{
+ return Inherited::ExitInstance();
+}
+
+LANGID CDirstatApp::GetLangid()
+{
+ return m_langid;
+}
+
+LANGID CDirstatApp::GetEffectiveLangid()
+{
+ if(GetOptions()->IsUseWdsLocale())
+ {
+ return GetLangid();
+ }
+ else
+ {
+ return ::GetUserDefaultLangID();
+ }
+}
+
+void CDirstatApp::OnAppAbout()
+{
+ StartAboutDialog();
+}
+
+void CDirstatApp::OnFileOpen()
+{
+ CSelectDrivesDlg dlg;
+ if(IDOK == dlg.DoModal())
+ {
+ CString path = CDirstatDoc::EncodeSelection((RADIO)dlg.m_radio, dlg.m_folderName, dlg.m_drives);
+ m_pDocTemplate->OpenDocumentFile(path, true);
+ }
+}
+
+#if SUPPORT_ELEVATION
+BOOL CDirstatApp::IsUACEnabled()
+{
+ OSVERSIONINFOEX osInfo;
+ DWORDLONG conditionMask = 0;
+
+ ZeroMemory(&osInfo, sizeof(osInfo));
+ osInfo.dwOSVersionInfoSize = sizeof(osInfo);
+ osInfo.dwMajorVersion = 6;
+ osInfo.dwMinorVersion = 0;
+ VER_SET_CONDITION(conditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
+ VER_SET_CONDITION(conditionMask, VER_MINORVERSION, VER_GREATER_EQUAL);
+
+ if (::VerifyVersionInfo(&osInfo, VER_MAJORVERSION | VER_MINORVERSION, conditionMask))
+ {
+ HKEY hKey;
+ if (::RegOpenKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", &hKey) == ERROR_SUCCESS)
+ {
+ DWORD value = 0;
+ if (::RegQueryValueExW(hKey, L"EnableLUA", NULL, NULL, NULL, &value) == ERROR_SUCCESS)
+ {
+ return (value != 0);
+ }
+ else
+ {
+ VTRACE(_T("IsUACEnabled::RegQueryValueExW failed"));
+ }
+
+ ::RegCloseKey(hKey);
+ }
+ else
+ {
+ VTRACE(_T("IsUACEnabled::RegOpenKeyW failed"));
+ }
+ }
+
+ return FALSE;
+}
+
+void CDirstatApp::OnUpdateRunElevated(CCmdUI *pCmdUI)
+{
+ pCmdUI->Enable(!IsAdmin() && IsUACEnabled());
+}
+
+#ifndef SEE_MASK_DEFAULT
+# define SEE_MASK_DEFAULT 0x00000000
+#endif
+
+void CDirstatApp::OnRunElevated()
+{
+ if (IsAdmin() || !IsUACEnabled())
+ return;
+
+ CString sAppName = GetAppFileName();
+
+ SHELLEXECUTEINFO shellInfo;
+ ZeroMemory(&shellInfo, sizeof(shellInfo));
+ shellInfo.cbSize = sizeof(shellInfo);
+ shellInfo.fMask = SEE_MASK_DEFAULT;
+ shellInfo.lpFile = sAppName;
+ shellInfo.lpVerb = _T("runas"); //DO NOT LOCALIZE
+ shellInfo.nShow = SW_NORMAL;
+
+
+ if (m_ElevationEvent)
+ {
+ ::CloseHandle(m_ElevationEvent);
+ }
+ m_ElevationEvent = ::CreateEvent(NULL, TRUE, FALSE, m_ElevationEventName);
+ if (!m_ElevationEvent)
+ {
+ VTRACE(_T("CreateEvent failed: %d"), GetLastError());
+ m_ElevationEvent = 0;
+ return;
+ }
+ if (ERROR_ALREADY_EXISTS == ::GetLastError())
+ {
+ VTRACE(_T("Event already exists"));
+ ::CloseHandle(m_ElevationEvent);
+ m_ElevationEvent = 0;
+ return;
+ }
+
+ if (!::ShellExecuteEx(&shellInfo))
+ {
+ VTRACE(_T("ShellExecuteEx failed to elevate %d"), GetLastError());
+
+ ::CloseHandle(m_ElevationEvent);
+ m_ElevationEvent = 0;
+
+ //TODO: Display message to user?
+ }
+ else
+ {
+ //TODO: Store configurations for the new app
+
+ GetMainFrame()->SendMessage(WM_CLOSE);
+ ::SetEvent(m_ElevationEvent); //Tell other process that we finished saving data (it waits only 20s)
+
+ ::CloseHandle(m_ElevationEvent);
+ m_ElevationEvent = 0;
+ }
+}
+#endif // SUPPORT_ELEVATION
+
+BOOL CDirstatApp::OnIdle(LONG lCount)
+{
+ bool more = false;
+
+ CDirstatDoc *doc = GetDocument();
+ CWorkLimiter limiter;
+ limiter.Start(600);
+ if((doc) && (!doc->Work(&limiter)))
+ {
+ more = true;
+ }
+
+ if(Inherited::OnIdle(lCount))
+ {
+ more = true;
+ }
+
+ // The status bar (RAM usage) is updated only when count == 0.
+ // That's why we call an extra OnIdle(0) here.
+ if(CWinThread::OnIdle(0))
+ {
+ more = true;
+ }
+
+ return more;
+}
+
+void CDirstatApp::OnHelpManual()
+{
+ DoContextHelp(IDH_StartPage);
+}
+
+void CDirstatApp::DoContextHelp(DWORD topic)
+{
+ if(::PathFileExists(m_pszHelpFilePath))
+ {
+ // I want a NULL parent window. So I don't use CWinApp::HtmlHelp().
+ ::HtmlHelp(NULL, m_pszHelpFilePath, HH_HELP_CONTEXT, topic);
+ }
+ else
+ {
+ CString msg;
+ msg.FormatMessage(IDS_HELPFILEsCOULDNOTBEFOUND, _T("windirstat.chm"));
+ // TODO: Add the option to download the "current language" help file ...
+ AfxMessageBox(msg);
+ }
+}
+
diff --git a/windirstat/windirstat.h b/windirstat/windirstat.h
index bf241f8..5430db0 100644
--- a/windirstat/windirstat.h
+++ b/windirstat/windirstat.h
@@ -18,7 +18,7 @@
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
+//
#ifndef __WDS_WINDIRSTAT_H__
#define __WDS_WINDIRSTAT_H__
diff --git a/windirstat/windirstat.vs14.vcxproj b/windirstat/windirstat.vs14.vcxproj
new file mode 100644
index 0000000..36a6adc
--- /dev/null
+++ b/windirstat/windirstat.vs14.vcxproj
@@ -0,0 +1,387 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{BD11B94C-6594-4477-9FDF-2E24447D1F14}</ProjectGuid>
+ <RootNamespace>windirstat</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v140</PlatformToolset>
+ <UseOfMfc>Static</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v140</PlatformToolset>
+ <UseOfMfc>Static</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v140</PlatformToolset>
+ <UseOfMfc>Static</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v140</PlatformToolset>
+ <UseOfMfc>Static</UseOfMfc>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>..\build\</OutDir>
+ <IntDir>..\intermediate\vs2015_$(Platform)_$(Configuration)\$(ProjectName)\</IntDir>
+ <TargetName>wds32D</TargetName>
+ <TargetExt>.exe</TargetExt>
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>..\build\</OutDir>
+ <IntDir>..\intermediate\vs2015_$(Platform)_$(Configuration)\$(ProjectName)\</IntDir>
+ <TargetName>wds64D</TargetName>
+ <TargetExt>.exe</TargetExt>
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>..\build\</OutDir>
+ <IntDir>..\intermediate\vs2015_$(Platform)_$(Configuration)\$(ProjectName)\</IntDir>
+ <TargetName>wds32</TargetName>
+ <TargetExt>.exe</TargetExt>
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>..\build\</OutDir>
+ <IntDir>..\intermediate\vs2015_$(Platform)_$(Configuration)\$(ProjectName)\</IntDir>
+ <TargetName>wds64</TargetName>
+ <TargetExt>.exe</TargetExt>
+ <LinkIncremental>false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..;.;..\common;Controls;Dialogs;..\3rdparty\lua\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;VTRACE_TO_CONSOLE=1;VTRACE_DETAIL=2;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <SmallerTypeCheck>true</SmallerTypeCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader></PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <RuntimeTypeInfo>false</RuntimeTypeInfo>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <ProgramDataBaseFileName>$(OutDir)wds32D.pdb</ProgramDataBaseFileName>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;VTRACE_TO_CONSOLE=1;VTRACE_DETAIL=2;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..;.;..\common;Controls;Dialogs;..\3rdparty\lua\src;..;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalDependencies>htmlhelp.lib;psapi.lib;delayimp.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)wds32D.exe</OutputFile>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalOptions>/delayload:psapi.dll /pdbaltpath:%_PDB% %(AdditionalOptions)</AdditionalOptions>
+ </Link>
+ <PreBuildEvent>
+ <Command>if not exist &quot;$(SolutionDir)common\buildnumber.h&quot; &quot;$(SolutionDir)common\buildinc.cmd&quot; &quot;$(SolutionDir)common&quot;</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..;.;..\common;Controls;Dialogs;..\3rdparty\lua\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_DEBUG;VTRACE_TO_CONSOLE=1;VTRACE_DETAIL=2;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <SmallerTypeCheck>true</SmallerTypeCheck>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader></PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <RuntimeTypeInfo>false</RuntimeTypeInfo>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <ProgramDataBaseFileName>$(OutDir)wds64D.pdb</ProgramDataBaseFileName>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;VTRACE_TO_CONSOLE=1;VTRACE_DETAIL=2;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..;.;..\common;Controls;Dialogs;..\3rdparty\lua\src;..;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <AdditionalDependencies>htmlhelp.lib;psapi.lib;delayimp.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)wds64D.exe</OutputFile>
+ <TargetMachine>MachineX64</TargetMachine>
+ <AdditionalOptions>/delayload:psapi.dll /pdbaltpath:%_PDB% %(AdditionalOptions)</AdditionalOptions>
+ </Link>
+ <PreBuildEvent>
+ <Command>if not exist &quot;$(SolutionDir)common\buildnumber.h&quot; &quot;$(SolutionDir)common\buildinc.cmd&quot; &quot;$(SolutionDir)common&quot;</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalOptions>/Oi /Ot %(AdditionalOptions)</AdditionalOptions>
+ <Optimization>Full</Optimization>
+ <AdditionalIncludeDirectories>..;.;..\common;Controls;Dialogs;..\3rdparty\lua\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader></PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <RuntimeTypeInfo>false</RuntimeTypeInfo>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <ProgramDataBaseFileName>$(OutDir)wds32.pdb</ProgramDataBaseFileName>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..;.;..\common;Controls;Dialogs;..\3rdparty\lua\src;..;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>htmlhelp.lib;psapi.lib;delayimp.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)wds32.exe</OutputFile>
+ <TargetMachine>MachineX86</TargetMachine>
+ <AdditionalOptions>/delayload:psapi.dll /pdbaltpath:%_PDB% /release %(AdditionalOptions)</AdditionalOptions>
+ </Link>
+ <PreBuildEvent>
+ <Command>if not exist &quot;$(SolutionDir)common\buildnumber.h&quot; &quot;$(SolutionDir)common\buildinc.cmd&quot; &quot;$(SolutionDir)common&quot;</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <AdditionalOptions>/Oi /Ot %(AdditionalOptions)</AdditionalOptions>
+ <Optimization>Full</Optimization>
+ <AdditionalIncludeDirectories>..;.;..\common;Controls;Dialogs;..\3rdparty\lua\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>false</MinimalRebuild>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader></PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <RuntimeTypeInfo>false</RuntimeTypeInfo>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <ProgramDataBaseFileName>$(OutDir)wds64.pdb</ProgramDataBaseFileName>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <AdditionalIncludeDirectories>..;.;..\common;Controls;Dialogs;..\3rdparty\lua\src;..;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>htmlhelp.lib;psapi.lib;delayimp.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)wds64.exe</OutputFile>
+ <TargetMachine>MachineX64</TargetMachine>
+ <AdditionalOptions>/delayload:psapi.dll /pdbaltpath:%_PDB% /release %(AdditionalOptions)</AdditionalOptions>
+ </Link>
+ <PreBuildEvent>
+ <Command>if not exist &quot;$(SolutionDir)common\buildnumber.h&quot; &quot;$(SolutionDir)common\buildinc.cmd&quot; &quot;$(SolutionDir)common&quot;</Command>
+ </PreBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="..\common\buildnumber.h" />
+ <ClInclude Include="..\common\commonhelpers.h" />
+ <ClInclude Include="..\common\common_rsrcstr.h" />
+ <ClInclude Include="..\common\cotaskmem.h" />
+ <ClInclude Include="..\common\hgtip.h" />
+ <ClInclude Include="..\common\mdexceptions.h" />
+ <ClInclude Include="..\common\SimpleIni.h" />
+ <ClInclude Include="..\common\tracer.h" />
+ <ClInclude Include="..\common\version.h" />
+ <ClInclude Include="..\common\wds_constants.h" />
+ <ClInclude Include="dirstatdoc.h" />
+ <ClInclude Include="dirstatview.h" />
+ <ClInclude Include="FileFindWDS.h" />
+ <ClInclude Include="getosplatformstring.h" />
+ <ClInclude Include="globalhelpers.h" />
+ <ClInclude Include="helpmap.h" />
+ <ClInclude Include="item.h" />
+ <ClInclude Include="layout.h" />
+ <ClInclude Include="mainframe.h" />
+ <ClInclude Include="ModalApiShuttle.h" />
+ <ClInclude Include="ModalShellApi.h" />
+ <ClInclude Include="mountpoints.h" />
+ <ClInclude Include="options.h" />
+ <ClInclude Include="osspecific.h" />
+ <ClInclude Include="PageCleanups.h" />
+ <ClInclude Include="PageGeneral.h" />
+ <ClInclude Include="PageTreelist.h" />
+ <ClInclude Include="PageTreemap.h" />
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="selectobject.h" />
+ <ClInclude Include="set.h" />
+ <ClInclude Include="stdafx.h" />
+ <ClInclude Include="WDS_Lua_C.h" />
+ <ClInclude Include="windirstat.h" />
+ <ClInclude Include="WorkLimiter.h" />
+ <ClInclude Include="Controls\ColorButton.h" />
+ <ClInclude Include="Controls\graphview.h" />
+ <ClInclude Include="Controls\myimagelist.h" />
+ <ClInclude Include="Controls\ownerdrawnlistcontrol.h" />
+ <ClInclude Include="Controls\pacman.h" />
+ <ClInclude Include="Controls\sortinglistcontrol.h" />
+ <ClInclude Include="Controls\TreeListControl.h" />
+ <ClInclude Include="Controls\treemap.h" />
+ <ClInclude Include="Controls\typeview.h" />
+ <ClInclude Include="Controls\xyslider.h" />
+ <ClInclude Include="Dialogs\AboutDlg.h" />
+ <ClInclude Include="Dialogs\DeleteWarningDlg.h" />
+ <ClInclude Include="Dialogs\SelectDrivesDlg.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\common\commonhelpers.cpp">
+ </ClCompile>
+ <ClCompile Include="..\common\wds_constants.cpp">
+ </ClCompile>
+ <ClCompile Include="dirstatdoc.cpp">
+ </ClCompile>
+ <ClCompile Include="dirstatview.cpp">
+ </ClCompile>
+ <ClCompile Include="FileFindWDS.cpp">
+ </ClCompile>
+ <ClCompile Include="getosplatformstring.cpp">
+ </ClCompile>
+ <ClCompile Include="globalhelpers.cpp">
+ </ClCompile>
+ <ClCompile Include="item.cpp">
+ </ClCompile>
+ <ClCompile Include="layout.cpp">
+ </ClCompile>
+ <ClCompile Include="mainframe.cpp">
+ </ClCompile>
+ <ClCompile Include="ModalApiShuttle.cpp">
+ </ClCompile>
+ <ClCompile Include="ModalShellApi.cpp">
+ </ClCompile>
+ <ClCompile Include="mountpoints.cpp">
+ </ClCompile>
+ <ClCompile Include="options.cpp">
+ </ClCompile>
+ <ClCompile Include="osspecific.cpp">
+ </ClCompile>
+ <ClCompile Include="PageCleanups.cpp">
+ </ClCompile>
+ <ClCompile Include="PageGeneral.cpp">
+ </ClCompile>
+ <ClCompile Include="PageTreelist.cpp">
+ </ClCompile>
+ <ClCompile Include="PageTreemap.cpp">
+ </ClCompile>
+ <ClCompile Include="windirstat.cpp">
+ </ClCompile>
+ <ClCompile Include="WorkLimiter.cpp">
+ </ClCompile>
+ <ClCompile Include="Controls\ColorButton.cpp">
+ </ClCompile>
+ <ClCompile Include="Controls\graphview.cpp">
+ </ClCompile>
+ <ClCompile Include="Controls\myimagelist.cpp">
+ </ClCompile>
+ <ClCompile Include="Controls\ownerdrawnlistcontrol.cpp">
+ </ClCompile>
+ <ClCompile Include="Controls\pacman.cpp">
+ </ClCompile>
+ <ClCompile Include="Controls\sortinglistcontrol.cpp">
+ </ClCompile>
+ <ClCompile Include="Controls\TreeListControl.cpp">
+ </ClCompile>
+ <ClCompile Include="Controls\treemap.cpp">
+ </ClCompile>
+ <ClCompile Include="Controls\typeview.cpp">
+ </ClCompile>
+ <ClCompile Include="Controls\xyslider.cpp">
+ </ClCompile>
+ <ClCompile Include="Dialogs\aboutdlg.cpp">
+ </ClCompile>
+ <ClCompile Include="Dialogs\DeleteWarningDlg.cpp">
+ </ClCompile>
+ <ClCompile Include="Dialogs\SelectDrivesDlg.cpp">
+ </ClCompile>
+ <ClCompile Include="WDS_Lua_C.c">
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="res\bitmap1.bmp" />
+ <None Include="res\icon1.ico" />
+ <None Include="res\junctionpoint.bmp" />
+ <None Include="res\license.rtf" />
+ <None Include="res\license.txt" />
+ <None Include="res\linkhand.cur" />
+ <None Include="res\Toolbar.bmp" />
+ <None Include="res\windirstat.manifest" />
+ <None Include="res\windirstat.rc2" />
+ <None Include="..\CONTRIBUTORS.md" />
+ <None Include="..\README.md" />
+ <None Include="..\common\BUILD" />
+ <None Include="..\common\buildinc.cmd" />
+ <None Include="..\common\build_luajit.cmd" />
+ <None Include="..\common\produce_vsprojects.cmd" />
+ <None Include="..\common\setvcvars.cmd" />
+ <None Include="..\premake4.lua" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="windirstat.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\3rdparty\lua\src\luajit2.vs14.vcxproj">
+ <Project>{9F35C2BB-DF1E-400A-A829-AE34E1C91A70}</Project>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
diff --git a/windirstat/windirstat.vs14.vcxproj.filters b/windirstat/windirstat.vs14.vcxproj.filters
new file mode 100644
index 0000000..62a7016
--- /dev/null
+++ b/windirstat/windirstat.vs14.vcxproj.filters
@@ -0,0 +1,348 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{CCC305FC-B7F2-8245-8946-E53E9C09FC77}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Header Files\Common">
+ <UniqueIdentifier>{3024BFFB-15AE-F34A-8E61-F7CACBE22408}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{E511C7A5-6A12-9F4C-9BB0-36A9B4998109}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Source Files\Common">
+ <UniqueIdentifier>{425B1319-44F5-A743-A620-F5A851E5A750}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Source Files\Controls">
+ <UniqueIdentifier>{CB5FD4E1-1BA3-9A4F-BB6F-28601205113B}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Source Files\Dialogs">
+ <UniqueIdentifier>{B2F3A075-A153-6240-A6DE-910D3BF62500}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Source Files\Lua">
+ <UniqueIdentifier>{EEB65C72-C0E2-484E-A9DD-06496684A70A}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Header Files\Controls">
+ <UniqueIdentifier>{8ACCDBFB-73A0-6D47-824F-7D6B03C1E794}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Header Files\Dialogs">
+ <UniqueIdentifier>{83969A47-EDEB-C444-A00E-3BA69DF32FC4}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{627E267E-6874-1E47-B9B3-80CF0B70487A}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Resource Files\Resources">
+ <UniqueIdentifier>{26A34776-A302-4246-945F-754B84B91BDE}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Special Files">
+ <UniqueIdentifier>{08AB409C-28F0-C74B-AAD5-FCCE01844956}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="res\bitmap1.bmp">
+ <Filter>Resource Files\Resources</Filter>
+ </None>
+ <None Include="res\icon1.ico">
+ <Filter>Resource Files\Resources</Filter>
+ </None>
+ <None Include="res\junctionpoint.bmp">
+ <Filter>Resource Files\Resources</Filter>
+ </None>
+ <None Include="res\license.rtf">
+ <Filter>Resource Files\Resources</Filter>
+ </None>
+ <None Include="res\license.txt">
+ <Filter>Resource Files\Resources</Filter>
+ </None>
+ <None Include="res\linkhand.cur">
+ <Filter>Resource Files\Resources</Filter>
+ </None>
+ <None Include="res\Toolbar.bmp">
+ <Filter>Resource Files\Resources</Filter>
+ </None>
+ <None Include="res\windirstat.manifest">
+ <Filter>Resource Files\Resources</Filter>
+ </None>
+ <None Include="res\windirstat.rc2">
+ <Filter>Resource Files\Resources</Filter>
+ </None>
+ <None Include="..\CONTRIBUTORS.md" />
+ <None Include="..\README.md" />
+ <None Include="..\common\BUILD">
+ <Filter>Special Files</Filter>
+ </None>
+ <None Include="..\common\buildinc.cmd">
+ <Filter>Special Files</Filter>
+ </None>
+ <None Include="..\common\build_luajit.cmd">
+ <Filter>Special Files</Filter>
+ </None>
+ <None Include="..\common\produce_vsprojects.cmd">
+ <Filter>Special Files</Filter>
+ </None>
+ <None Include="..\common\setvcvars.cmd">
+ <Filter>Special Files</Filter>
+ </None>
+ <None Include="..\premake4.lua">
+ <Filter>Special Files</Filter>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\common\buildnumber.h">
+ <Filter>Header Files\Common</Filter>
+ </ClInclude>
+ <ClInclude Include="..\common\commonhelpers.h">
+ <Filter>Header Files\Common</Filter>
+ </ClInclude>
+ <ClInclude Include="..\common\common_rsrcstr.h">
+ <Filter>Header Files\Common</Filter>
+ </ClInclude>
+ <ClInclude Include="..\common\cotaskmem.h">
+ <Filter>Header Files\Common</Filter>
+ </ClInclude>
+ <ClInclude Include="..\common\hgtip.h">
+ <Filter>Header Files\Common</Filter>
+ </ClInclude>
+ <ClInclude Include="..\common\mdexceptions.h">
+ <Filter>Header Files\Common</Filter>
+ </ClInclude>
+ <ClInclude Include="..\common\SimpleIni.h">
+ <Filter>Header Files\Common</Filter>
+ </ClInclude>
+ <ClInclude Include="..\common\tracer.h">
+ <Filter>Header Files\Common</Filter>
+ </ClInclude>
+ <ClInclude Include="..\common\version.h">
+ <Filter>Header Files\Common</Filter>
+ </ClInclude>
+ <ClInclude Include="..\common\wds_constants.h">
+ <Filter>Header Files\Common</Filter>
+ </ClInclude>
+ <ClInclude Include="dirstatdoc.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="dirstatview.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="FileFindWDS.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="getosplatformstring.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="globalhelpers.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="helpmap.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="item.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="layout.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mainframe.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ModalApiShuttle.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ModalShellApi.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="mountpoints.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="options.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="osspecific.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="PageCleanups.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="PageGeneral.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="PageTreelist.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="PageTreemap.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="selectobject.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="set.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="stdafx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="WDS_Lua_C.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="windirstat.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="WorkLimiter.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Controls\ColorButton.h">
+ <Filter>Header Files\Controls</Filter>
+ </ClInclude>
+ <ClInclude Include="Controls\graphview.h">
+ <Filter>Header Files\Controls</Filter>
+ </ClInclude>
+ <ClInclude Include="Controls\myimagelist.h">
+ <Filter>Header Files\Controls</Filter>
+ </ClInclude>
+ <ClInclude Include="Controls\ownerdrawnlistcontrol.h">
+ <Filter>Header Files\Controls</Filter>
+ </ClInclude>
+ <ClInclude Include="Controls\pacman.h">
+ <Filter>Header Files\Controls</Filter>
+ </ClInclude>
+ <ClInclude Include="Controls\sortinglistcontrol.h">
+ <Filter>Header Files\Controls</Filter>
+ </ClInclude>
+ <ClInclude Include="Controls\TreeListControl.h">
+ <Filter>Header Files\Controls</Filter>
+ </ClInclude>
+ <ClInclude Include="Controls\treemap.h">
+ <Filter>Header Files\Controls</Filter>
+ </ClInclude>
+ <ClInclude Include="Controls\typeview.h">
+ <Filter>Header Files\Controls</Filter>
+ </ClInclude>
+ <ClInclude Include="Controls\xyslider.h">
+ <Filter>Header Files\Controls</Filter>
+ </ClInclude>
+ <ClInclude Include="Dialogs\AboutDlg.h">
+ <Filter>Header Files\Dialogs</Filter>
+ </ClInclude>
+ <ClInclude Include="Dialogs\DeleteWarningDlg.h">
+ <Filter>Header Files\Dialogs</Filter>
+ </ClInclude>
+ <ClInclude Include="Dialogs\SelectDrivesDlg.h">
+ <Filter>Header Files\Dialogs</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\common\commonhelpers.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="..\common\wds_constants.cpp">
+ <Filter>Source Files\Common</Filter>
+ </ClCompile>
+ <ClCompile Include="dirstatdoc.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="dirstatview.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="FileFindWDS.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="getosplatformstring.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="globalhelpers.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="item.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="layout.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mainframe.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ModalApiShuttle.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ModalShellApi.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="mountpoints.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="options.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="osspecific.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="PageCleanups.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="PageGeneral.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="PageTreelist.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="PageTreemap.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="windirstat.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="WorkLimiter.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="Controls\ColorButton.cpp">
+ <Filter>Source Files\Controls</Filter>
+ </ClCompile>
+ <ClCompile Include="Controls\graphview.cpp">
+ <Filter>Source Files\Controls</Filter>
+ </ClCompile>
+ <ClCompile Include="Controls\myimagelist.cpp">
+ <Filter>Source Files\Controls</Filter>
+ </ClCompile>
+ <ClCompile Include="Controls\ownerdrawnlistcontrol.cpp">
+ <Filter>Source Files\Controls</Filter>
+ </ClCompile>
+ <ClCompile Include="Controls\pacman.cpp">
+ <Filter>Source Files\Controls</Filter>
+ </ClCompile>
+ <ClCompile Include="Controls\sortinglistcontrol.cpp">
+ <Filter>Source Files\Controls</Filter>
+ </ClCompile>
+ <ClCompile Include="Controls\TreeListControl.cpp">
+ <Filter>Source Files\Controls</Filter>
+ </ClCompile>
+ <ClCompile Include="Controls\treemap.cpp">
+ <Filter>Source Files\Controls</Filter>
+ </ClCompile>
+ <ClCompile Include="Controls\typeview.cpp">
+ <Filter>Source Files\Controls</Filter>
+ </ClCompile>
+ <ClCompile Include="Controls\xyslider.cpp">
+ <Filter>Source Files\Controls</Filter>
+ </ClCompile>
+ <ClCompile Include="Dialogs\aboutdlg.cpp">
+ <Filter>Source Files\Dialogs</Filter>
+ </ClCompile>
+ <ClCompile Include="Dialogs\DeleteWarningDlg.cpp">
+ <Filter>Source Files\Dialogs</Filter>
+ </ClCompile>
+ <ClCompile Include="Dialogs\SelectDrivesDlg.cpp">
+ <Filter>Source Files\Dialogs</Filter>
+ </ClCompile>
+ <ClCompile Include="WDS_Lua_C.c">
+ <Filter>Source Files\Lua</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="windirstat.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project>
diff --git a/windirstat/windirstat.vs8.vcproj b/windirstat/windirstat.vs8.vcproj
index ef851c8..321b1fd 100644
--- a/windirstat/windirstat.vs8.vcproj
+++ b/windirstat/windirstat.vs8.vcproj
@@ -21,7 +21,7 @@
<Configuration
Name="Debug|Win32"
OutputDirectory="..\build"
- IntermediateDirectory="..\intermediate\vs2005_$(PlatformName)_$(ConfigurationName)\$(ProjectName)"
+ IntermediateDirectory="..\intermediate\vs2005_$(Platform)_$(Configuration)\$(ProjectName)"
ConfigurationType="1"
UseOfMFC="1"
CharacterSet="1"
@@ -46,7 +46,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..;.;..\common;Controls;Dialogs;..\3rdparty\lua\src"
- PreprocessorDefinitions="_DEBUG;VTRACE_TO_CONSOLE=1;VTRACE_DETAIL=2;WINVER=0x0500;HAVE_WIN7_SDK=1"
+ PreprocessorDefinitions="_DEBUG;VTRACE_TO_CONSOLE=1;VTRACE_DETAIL=2;WINVER=0x0500"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
EnableFunctionLevelLinking="true"
@@ -64,7 +64,7 @@
<Tool
Name="VCResourceCompilerTool"
AdditionalOptions="/nologo /l409"
- PreprocessorDefinitions="_DEBUG;VTRACE_TO_CONSOLE=1;VTRACE_DETAIL=2;WINVER=0x0500;HAVE_WIN7_SDK=1"
+ PreprocessorDefinitions="_DEBUG;VTRACE_TO_CONSOLE=1;VTRACE_DETAIL=2;WINVER=0x0500"
AdditionalIncludeDirectories="..;.;..\common;Controls;Dialogs;..\3rdparty\lua\src;..;$(IntDir)"
/>
<Tool
@@ -76,829 +76,3 @@
AdditionalDependencies="htmlhelp.lib psapi.lib delayimp.lib ..\..\..\build\luajit2_$(PlatformName).lib"
OutputFile="$(OutDir)\wds32D.exe"
LinkIncremental="1"
- AdditionalLibraryDirectories="$(IntDir)"
- GenerateDebugInformation="true"
- ProgramDataBaseFileName="$(OutDir)\wds32D.pdb"
- SubSystem="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- AdditionalManifestFiles="res/windirstat.manifest"
- AssemblyIdentity="WinDirStat_Team.WinDirStat.windirstat, processorArchitecture=x86, version=1.3, type=win32"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="..\build"
- IntermediateDirectory="..\intermediate\vs2005_$(PlatformName)_$(ConfigurationName)\$(ProjectName)"
- ConfigurationType="1"
- UseOfMFC="1"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="if not exist &quot;$(SolutionDir)common\buildnumber.h&quot; &quot;$(SolutionDir)common\buildinc.cmd&quot; &quot;$(SolutionDir)common&quot;"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="..;.;..\common;Controls;Dialogs;..\3rdparty\lua\src"
- PreprocessorDefinitions="_DEBUG;VTRACE_TO_CONSOLE=1;VTRACE_DETAIL=2;WINVER=0x0500;HAVE_WIN7_SDK=1"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- EnableFunctionLevelLinking="true"
- RuntimeTypeInfo="false"
- TreatWChar_tAsBuiltInType="true"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="true"
- ProgramDataBaseFileName="$(OutDir)\wds64D.pdb"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalOptions="/nologo /l409"
- PreprocessorDefinitions="_DEBUG;VTRACE_TO_CONSOLE=1;VTRACE_DETAIL=2;WINVER=0x0500;HAVE_WIN7_SDK=1"
- AdditionalIncludeDirectories="..;.;..\common;Controls;Dialogs;..\3rdparty\lua\src;..;$(IntDir)"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/delayload:psapi.dll /pdbaltpath:%_PDB%"
- AdditionalDependencies="htmlhelp.lib psapi.lib delayimp.lib ..\..\..\build\luajit2_$(PlatformName).lib"
- OutputFile="$(OutDir)\wds64D.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories="$(IntDir)"
- GenerateDebugInformation="true"
- ProgramDataBaseFileName="$(OutDir)\wds64D.pdb"
- SubSystem="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- AdditionalManifestFiles="res/windirstat.manifest"
- AssemblyIdentity="WinDirStat_Team.WinDirStat.windirstat, processorArchitecture=amd64, version=1.3, type=win32"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="..\build"
- IntermediateDirectory="..\intermediate\vs2005_$(PlatformName)_$(ConfigurationName)\$(ProjectName)"
- ConfigurationType="1"
- UseOfMFC="1"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="if not exist &quot;$(SolutionDir)common\buildnumber.h&quot; &quot;$(SolutionDir)common\buildinc.cmd&quot; &quot;$(SolutionDir)common&quot;"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/Oi /Ot"
- Optimization="3"
- AdditionalIncludeDirectories="..;.;..\common;Controls;Dialogs;..\3rdparty\lua\src"
- PreprocessorDefinitions="NDEBUG;WINVER=0x0500;HAVE_WIN7_SDK=1"
- StringPooling="true"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="true"
- RuntimeTypeInfo="false"
- TreatWChar_tAsBuiltInType="true"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="true"
- ProgramDataBaseFileName="$(OutDir)\wds32.pdb"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalOptions="/nologo /l409"
- PreprocessorDefinitions="NDEBUG;WINVER=0x0500;HAVE_WIN7_SDK=1"
- AdditionalIncludeDirectories="..;.;..\common;Controls;Dialogs;..\3rdparty\lua\src;..;$(IntDir)"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/delayload:psapi.dll /pdbaltpath:%_PDB% /release"
- AdditionalDependencies="htmlhelp.lib psapi.lib delayimp.lib ..\..\..\build\luajit2_$(PlatformName).lib"
- OutputFile="$(OutDir)\wds32.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories="$(IntDir)"
- GenerateDebugInformation="true"
- ProgramDataBaseFileName="$(OutDir)\wds32.pdb"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- AdditionalManifestFiles="res/windirstat.manifest"
- AssemblyIdentity="WinDirStat_Team.WinDirStat.windirstat, processorArchitecture=x86, version=1.3, type=win32"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="..\build"
- IntermediateDirectory="..\intermediate\vs2005_$(PlatformName)_$(ConfigurationName)\$(ProjectName)"
- ConfigurationType="1"
- UseOfMFC="1"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="if not exist &quot;$(SolutionDir)common\buildnumber.h&quot; &quot;$(SolutionDir)common\buildinc.cmd&quot; &quot;$(SolutionDir)common&quot;"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/Oi /Ot"
- Optimization="3"
- AdditionalIncludeDirectories="..;.;..\common;Controls;Dialogs;..\3rdparty\lua\src"
- PreprocessorDefinitions="NDEBUG;WINVER=0x0500;HAVE_WIN7_SDK=1"
- StringPooling="true"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="true"
- RuntimeTypeInfo="false"
- TreatWChar_tAsBuiltInType="true"
- UsePrecompiledHeader="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="true"
- ProgramDataBaseFileName="$(OutDir)\wds64.pdb"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalOptions="/nologo /l409"
- PreprocessorDefinitions="NDEBUG;WINVER=0x0500;HAVE_WIN7_SDK=1"
- AdditionalIncludeDirectories="..;.;..\common;Controls;Dialogs;..\3rdparty\lua\src;..;$(IntDir)"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/delayload:psapi.dll /pdbaltpath:%_PDB% /release"
- AdditionalDependencies="htmlhelp.lib psapi.lib delayimp.lib ..\..\..\build\luajit2_$(PlatformName).lib"
- OutputFile="$(OutDir)\wds64.exe"
- LinkIncremental="1"
- AdditionalLibraryDirectories="$(IntDir)"
- GenerateDebugInformation="true"
- ProgramDataBaseFileName="$(OutDir)\wds64.pdb"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- AdditionalManifestFiles="res/windirstat.manifest"
- AssemblyIdentity="WinDirStat_Team.WinDirStat.windirstat, processorArchitecture=amd64, version=1.3, type=win32"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <File
- RelativePath="..\CHANGELOG.txt"
- >
- </File>
- <File
- RelativePath="..\CONTRIBUTORS.txt"
- >
- </File>
- <Filter
- Name="Header Files"
- Filter=""
- >
- <Filter
- Name="Common"
- Filter=""
- >
- <File
- RelativePath="..\common\SimpleIni.h"
- >
- </File>
- <File
- RelativePath="..\common\buildnumber.h"
- >
- </File>
- <File
- RelativePath="..\common\common_rsrcstr.h"
- >
- </File>
- <File
- RelativePath="..\common\commonhelpers.h"
- >
- </File>
- <File
- RelativePath="..\common\cotaskmem.h"
- >
- </File>
- <File
- RelativePath="..\common\hgtip.h"
- >
- </File>
- <File
- RelativePath="..\common\mdexceptions.h"
- >
- </File>
- <File
- RelativePath="..\common\platform.h"
- >
- </File>
- <File
- RelativePath="..\common\tracer.h"
- >
- </File>
- <File
- RelativePath="..\common\version.h"
- >
- </File>
- <File
- RelativePath="..\common\wds_constants.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Controls"
- Filter=""
- >
- <File
- RelativePath="Controls\ColorButton.h"
- >
- </File>
- <File
- RelativePath="Controls\TreeListControl.h"
- >
- </File>
- <File
- RelativePath="Controls\graphview.h"
- >
- </File>
- <File
- RelativePath="Controls\myimagelist.h"
- >
- </File>
- <File
- RelativePath="Controls\ownerdrawnlistcontrol.h"
- >
- </File>
- <File
- RelativePath="Controls\pacman.h"
- >
- </File>
- <File
- RelativePath="Controls\sortinglistcontrol.h"
- >
- </File>
- <File
- RelativePath="Controls\treemap.h"
- >
- </File>
- <File
- RelativePath="Controls\typeview.h"
- >
- </File>
- <File
- RelativePath="Controls\xyslider.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Dialogs"
- Filter=""
- >
- <File
- RelativePath="Dialogs\AboutDlg.h"
- >
- </File>
- <File
- RelativePath="Dialogs\DeleteWarningDlg.h"
- >
- </File>
- <File
- RelativePath="Dialogs\SelectDrivesDlg.h"
- >
- </File>
- </Filter>
- <File
- RelativePath="FileFindWDS.h"
- >
- </File>
- <File
- RelativePath="ModalApiShuttle.h"
- >
- </File>
- <File
- RelativePath="ModalShellApi.h"
- >
- </File>
- <File
- RelativePath="PageCleanups.h"
- >
- </File>
- <File
- RelativePath="PageGeneral.h"
- >
- </File>
- <File
- RelativePath="PageTreelist.h"
- >
- </File>
- <File
- RelativePath="PageTreemap.h"
- >
- </File>
- <File
- RelativePath="WDS_Lua_C.h"
- >
- </File>
- <File
- RelativePath="dirstatdoc.h"
- >
- </File>
- <File
- RelativePath="dirstatview.h"
- >
- </File>
- <File
- RelativePath="getosplatformstring.h"
- >
- </File>
- <File
- RelativePath="globalhelpers.h"
- >
- </File>
- <File
- RelativePath="helpmap.h"
- >
- </File>
- <File
- RelativePath="item.h"
- >
- </File>
- <File
- RelativePath="layout.h"
- >
- </File>
- <File
- RelativePath="mainframe.h"
- >
- </File>
- <File
- RelativePath="mountpoints.h"
- >
- </File>
- <File
- RelativePath="options.h"
- >
- </File>
- <File
- RelativePath="osspecific.h"
- >
- </File>
- <File
- RelativePath="resource.h"
- >
- </File>
- <File
- RelativePath="selectobject.h"
- >
- </File>
- <File
- RelativePath="set.h"
- >
- </File>
- <File
- RelativePath="stdafx.h"
- >
- </File>
- <File
- RelativePath="windirstat.h"
- >
- </File>
- </Filter>
- <File
- RelativePath="..\README.md"
- >
- </File>
- <Filter
- Name="Resource Files"
- Filter=""
- >
- <Filter
- Name="Resources"
- Filter=""
- >
- <File
- RelativePath="res\Toolbar.bmp"
- >
- </File>
- <File
- RelativePath="res\bitmap1.bmp"
- >
- </File>
- <File
- RelativePath="res\icon1.ico"
- >
- </File>
- <File
- RelativePath="res\icon2.ico"
- >
- </File>
- <File
- RelativePath="res\junctionpoint.bmp"
- >
- </File>
- <File
- RelativePath="res\license.txt"
- >
- </File>
- <File
- RelativePath="res\linkhand.cur"
- >
- </File>
- <File
- RelativePath="res\windirstat.manifest"
- >
- </File>
- <File
- RelativePath="res\windirstat.rc2"
- >
- </File>
- </Filter>
- <File
- RelativePath="windirstat.rc"
- >
- </File>
- </Filter>
- <Filter
- Name="Source Files"
- Filter=""
- >
- <Filter
- Name="Common"
- Filter=""
- >
- <File
- RelativePath="..\common\commonhelpers.cpp"
- >
- </File>
- <File
- RelativePath="..\common\platform.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Controls"
- Filter=""
- >
- <File
- RelativePath="Controls\ColorButton.cpp"
- >
- </File>
- <File
- RelativePath="Controls\TreeListControl.cpp"
- >
- </File>
- <File
- RelativePath="Controls\graphview.cpp"
- >
- </File>
- <File
- RelativePath="Controls\myimagelist.cpp"
- >
- </File>
- <File
- RelativePath="Controls\ownerdrawnlistcontrol.cpp"
- >
- </File>
- <File
- RelativePath="Controls\pacman.cpp"
- >
- </File>
- <File
- RelativePath="Controls\sortinglistcontrol.cpp"
- >
- </File>
- <File
- RelativePath="Controls\treemap.cpp"
- >
- </File>
- <File
- RelativePath="Controls\typeview.cpp"
- >
- </File>
- <File
- RelativePath="Controls\xyslider.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Dialogs"
- Filter=""
- >
- <File
- RelativePath="Dialogs\DeleteWarningDlg.cpp"
- >
- </File>
- <File
- RelativePath="Dialogs\SelectDrivesDlg.cpp"
- >
- </File>
- <File
- RelativePath="Dialogs\aboutdlg.cpp"
- >
- </File>
- </Filter>
- <File
- RelativePath="FileFindWDS.cpp"
- >
- </File>
- <Filter
- Name="Lua"
- Filter=""
- >
- <File
- RelativePath="WDS_Lua_C.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- CompileAs="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- CompileAs="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- CompileAs="1"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- CompileAs="1"
- />
- </FileConfiguration>
- </File>
- </Filter>
- <File
- RelativePath="ModalApiShuttle.cpp"
- >
- </File>
- <File
- RelativePath="ModalShellApi.cpp"
- >
- </File>
- <File
- RelativePath="PageCleanups.cpp"
- >
- </File>
- <File
- RelativePath="PageGeneral.cpp"
- >
- </File>
- <File
- RelativePath="PageTreelist.cpp"
- >
- </File>
- <File
- RelativePath="PageTreemap.cpp"
- >
- </File>
- <File
- RelativePath="dirstatdoc.cpp"
- >
- </File>
- <File
- RelativePath="dirstatview.cpp"
- >
- </File>
- <File
- RelativePath="getosplatformstring.cpp"
- >
- </File>
- <File
- RelativePath="globalhelpers.cpp"
- >
- </File>
- <File
- RelativePath="item.cpp"
- >
- </File>
- <File
- RelativePath="layout.cpp"
- >
- </File>
- <File
- RelativePath="mainframe.cpp"
- >
- </File>
- <File
- RelativePath="mountpoints.cpp"
- >
- </File>
- <File
- RelativePath="options.cpp"
- >
- </File>
- <File
- RelativePath="osspecific.cpp"
- >
- </File>
- <File
- RelativePath="windirstat.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Special Files"
- Filter=""
- >
- <File
- RelativePath="..\common\BUILD"
- >
- </File>
- <File
- RelativePath="..\common\build_luajit.cmd"
- >
- </File>
- <File
- RelativePath="..\common\buildinc.cmd"
- >
- </File>
- <File
- RelativePath="..\premake4.lua"
- >
- </File>
- <File
- RelativePath="..\common\produce_vsprojects.cmd"
- >
- </File>
- <File
- RelativePath="..\common\setvcvars.cmd"
- >
- </File>
- </Filter>
- <File
- RelativePath="..\TESTPLAN.txt"
- >
- </File>
- <File
- RelativePath="..\TODO.txt"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>