• R/O
  • HTTP
  • SSH
  • HTTPS

thirdparty-altwindirstat: Commit

A - since abandoned - fork of WinDirStat which had some interesting changes.

Original home: https://github.com/ariccio/altWinDirStat


Commit MetaInfo

Revisionfac489bd1be265e2b9a037ade47c73563ca7d388 (tree)
Time2016-10-09 12:14:12
AuthorAlexander Riccio <alexander@ricc...>
CommiterAlexander Riccio

Log Message

Hmm, it looks like I forgot to commit a few changes

Change Summary

Incremental Difference

--- a/WinDirStat/windirstat/ChildrenHeapManager.h
+++ b/WinDirStat/windirstat/ChildrenHeapManager.h
@@ -104,6 +104,8 @@ struct child_info_block_manager final {
104104 const rsize_t size_of_a_single_struct_in_bytes = sizeof( child_info );
105105 const size_t total_size_needed = ( size_of_a_single_struct_in_bytes + ( number_of_characters_needed * sizeof( wchar_t ) ) );
106106 void* const memory_block = malloc( total_size_needed );
107+#pragma message("This is temporary!")
108+#pragma warning(suppress: 6386)
107109 m_child_info_ptr = new ( memory_block ) child_info( number_of_characters_needed, child_count );
108110 }
109111 ~child_info_block_manager( ) {
--- a/WinDirStat/windirstat/globalhelpers.cpp
+++ b/WinDirStat/windirstat/globalhelpers.cpp
@@ -1112,7 +1112,7 @@ BOOL GetItem_HDM_GETITEM( _In_ const HWND hWnd, _In_ _In_range_( >=, 0 ) const i
11121112 return static_cast<BOOL>( get_item_result );
11131113 }
11141114
1115-BOOL SetItem_HDM_SETITEM( _In_ const HWND hWnd, _In_range_( >=, 0 ) const int nPos, _In_ const HDITEM * const pHeaderItem ) {
1115+BOOL SetItem_HDM_SETITEM( _In_ const HWND hWnd, _In_ _In_range_( >=, 0 ) const int nPos, _In_ const HDITEM * const pHeaderItem ) {
11161116 ASSERT( ::IsWindow( hWnd ) );
11171117 //_AFXCMN_INLINE BOOL CHeaderCtrl::SetItem(_In_ int nPos, _In_ HDITEM* pHeaderItem)
11181118 //{ ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, HDM_SETITEM, nPos, (LPARAM)pHeaderItem); }
--- a/WinDirStat/windirstat/ownerdrawnlistcontrol.h
+++ b/WinDirStat/windirstat/ownerdrawnlistcontrol.h
@@ -816,6 +816,55 @@ public:
816816
817817 INT col_order_array[ countArray ] = { 0 };
818818
819+ /*
820+CWnd* PASCAL CWnd::FromHandle(HWND hWnd)
821+{
822+ CHandleMap* pMap = afxMapHWND(TRUE); //create map if not exist
823+ ASSERT(pMap != NULL);
824+ CWnd* pWnd = (CWnd*)pMap->FromHandle(hWnd);
825+
826+ pWnd->AttachControlSite(pMap);
827+
828+ ASSERT(pWnd == NULL || pWnd->m_hWnd == hWnd);
829+ return pWnd;
830+}
831+
832+CHeaderCtrl* CListCtrl::GetHeaderCtrl() const
833+{
834+ ASSERT(::IsWindow(m_hWnd));
835+
836+ HWND hWnd = (HWND) ::SendMessage(m_hWnd, LVM_GETHEADER, 0, 0);
837+ if (hWnd == NULL)
838+ return NULL;
839+ else
840+ return (CHeaderCtrl*) CHeaderCtrl::FromHandle(hWnd);
841+}
842+
843+
844+BOOL CListCtrl::GetColumnOrderArray(LPINT piArray, int iCount = -1) const
845+{
846+ ASSERT(::IsWindow(m_hWnd));
847+
848+ // if -1 was passed, find the count ourselves
849+
850+ int nCount = iCount;
851+ if (nCount == -1)
852+ {
853+ CHeaderCtrl* pCtrl = GetHeaderCtrl();
854+ ASSERT(pCtrl != NULL);
855+ if (pCtrl != NULL)
856+ nCount = pCtrl->GetItemCount();
857+ }
858+ if (nCount == -1)
859+ return FALSE;
860+
861+ ASSERT(AfxIsValidAddress(piArray, nCount * sizeof(int)));
862+ return (BOOL) ::SendMessage(m_hWnd, LVM_GETCOLUMNORDERARRAY,
863+ (WPARAM) nCount, (LPARAM) piArray);
864+}
865+
866+ */
867+
819868 const auto res_2 = CListCtrl::GetColumnOrderArray( col_order_array, itemCount_default_type );
820869 if ( res_2 == 0 ) {
821870 displayWindowsMsgBoxWithMessage( L"Error in COwnerDrawnListCtrl::LoadPersistenAttributes - GetColumnOrderArray failed!(aborting)" );
@@ -835,6 +884,18 @@ public:
835884
836885 CPersistence::GetColumnOrder( m_persistent_name, col_order_array, itemCount, column_order_default.c_str( ) );
837886
887+ /*
888+BOOL CListCtrl::SetColumnOrderArray(int iCount, LPINT piArray)
889+{
890+ ASSERT(::IsWindow(m_hWnd));
891+ ASSERT(AfxIsValidAddress(piArray, iCount * sizeof(int), FALSE));
892+
893+ return (BOOL) ::SendMessage(m_hWnd, LVM_SETCOLUMNORDERARRAY,
894+ (WPARAM) iCount, (LPARAM) piArray);
895+}
896+
897+ */
898+
838899 const auto res2 = CListCtrl::SetColumnOrderArray( static_cast<int>( itemCount ), col_order_array );
839900 if ( res2 == 0 ) {
840901 displayWindowsMsgBoxWithMessage( L"Error in COwnerDrawnListCtrl::LoadPersistenAttributes - SetColumnOrderArray failed!(aborting)" );
@@ -924,7 +985,7 @@ public:
924985 //VERIFY( CListCtrl::SortItems( &_CompareFunc, reinterpret_cast<DWORD_PTR>( &m_sorting ) ) );
925986
926987 HDITEM hditem = { };
927- auto thisHeaderCtrl = CListCtrl::GetHeaderCtrl( );
988+ CHeaderCtrl* const thisHeaderCtrl = CListCtrl::GetHeaderCtrl( );
928989
929990 //http://msdn.microsoft.com/en-us/library/windows/desktop/bb775247(v=vs.85).aspx specifies 260
930991 const rsize_t text_char_count = 260u;
@@ -1057,7 +1118,7 @@ _AFXCMN_INLINE BOOL CListCtrl::DeleteItem(_In_ int nItem)
10571118 //`/analyze` is confused.
10581119 return;
10591120 }
1060- const auto w = COwnerDrawnListCtrl::GetSubItemWidth( item, col );
1121+ const INT w = COwnerDrawnListCtrl::GetSubItemWidth( item, col );
10611122 //_AFXCMN_INLINE int CListCtrl::GetStringWidth(_In_z_ LPCTSTR lpsz) const
10621123 //{ ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_GETSTRINGWIDTH, 0, (LPARAM)lpsz); }
10631124
@@ -1067,6 +1128,7 @@ _AFXCMN_INLINE BOOL CListCtrl::DeleteItem(_In_ int nItem)
10671128 width = w;
10681129 }
10691130 }
1131+ ASSERT( width >= 0 );
10701132 VERIFY( SetColumnWidth_LVM_SETCOLUMNWIDTH( m_hWnd, col, width + 5 ) );
10711133 //VERIFY( CListCtrl::SetColumnWidth( col, width + 5 ) );
10721134 }
--- a/WinDirStat/windirstat/stdafx.h
+++ b/WinDirStat/windirstat/stdafx.h
@@ -15,7 +15,7 @@
1515
1616 #pragma message( "defining `_HAS_EXCEPTIONS 0`..." )
1717
18-#define _HAS_EXCEPTIONS 0
18+//#define _HAS_EXCEPTIONS 0
1919
2020 #ifndef VC_EXTRALEAN
2121
--- a/WinDirStat/windirstat/windirstat.vcxproj
+++ b/WinDirStat/windirstat/windirstat.vcxproj
@@ -147,7 +147,7 @@
147147 <IntDir>Release\</IntDir>
148148 <LinkIncremental>false</LinkIncremental>
149149 <EmbedManifest>false</EmbedManifest>
150- <CodeAnalysisRuleSet>..\WinDirStat.ruleset</CodeAnalysisRuleSet>
150+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
151151 <RunCodeAnalysis>true</RunCodeAnalysis>
152152 </PropertyGroup>
153153 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Intel_SSA|Win32'">
@@ -169,7 +169,7 @@
169169 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
170170 <LinkIncremental>false</LinkIncremental>
171171 <EmbedManifest>false</EmbedManifest>
172- <CodeAnalysisRuleSet>..\WinDirStat.ruleset</CodeAnalysisRuleSet>
172+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
173173 <RunCodeAnalysis>true</RunCodeAnalysis>
174174 </PropertyGroup>
175175 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Intel_SSA|x64'">
Show on old repository browser