A - since abandoned - fork of WinDirStat which had some interesting changes.
Original home: https://github.com/ariccio/altWinDirStat
Revision | fac489bd1be265e2b9a037ade47c73563ca7d388 (tree) |
---|---|
Time | 2016-10-09 12:14:12 |
Author | Alexander Riccio <alexander@ricc...> |
Commiter | Alexander Riccio |
Hmm, it looks like I forgot to commit a few changes
@@ -104,6 +104,8 @@ struct child_info_block_manager final { | ||
104 | 104 | const rsize_t size_of_a_single_struct_in_bytes = sizeof( child_info ); |
105 | 105 | const size_t total_size_needed = ( size_of_a_single_struct_in_bytes + ( number_of_characters_needed * sizeof( wchar_t ) ) ); |
106 | 106 | void* const memory_block = malloc( total_size_needed ); |
107 | +#pragma message("This is temporary!") | |
108 | +#pragma warning(suppress: 6386) | |
107 | 109 | m_child_info_ptr = new ( memory_block ) child_info( number_of_characters_needed, child_count ); |
108 | 110 | } |
109 | 111 | ~child_info_block_manager( ) { |
@@ -1112,7 +1112,7 @@ BOOL GetItem_HDM_GETITEM( _In_ const HWND hWnd, _In_ _In_range_( >=, 0 ) const i | ||
1112 | 1112 | return static_cast<BOOL>( get_item_result ); |
1113 | 1113 | } |
1114 | 1114 | |
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 ) { | |
1116 | 1116 | ASSERT( ::IsWindow( hWnd ) ); |
1117 | 1117 | //_AFXCMN_INLINE BOOL CHeaderCtrl::SetItem(_In_ int nPos, _In_ HDITEM* pHeaderItem) |
1118 | 1118 | //{ ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, HDM_SETITEM, nPos, (LPARAM)pHeaderItem); } |
@@ -816,6 +816,55 @@ public: | ||
816 | 816 | |
817 | 817 | INT col_order_array[ countArray ] = { 0 }; |
818 | 818 | |
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 | + | |
819 | 868 | const auto res_2 = CListCtrl::GetColumnOrderArray( col_order_array, itemCount_default_type ); |
820 | 869 | if ( res_2 == 0 ) { |
821 | 870 | displayWindowsMsgBoxWithMessage( L"Error in COwnerDrawnListCtrl::LoadPersistenAttributes - GetColumnOrderArray failed!(aborting)" ); |
@@ -835,6 +884,18 @@ public: | ||
835 | 884 | |
836 | 885 | CPersistence::GetColumnOrder( m_persistent_name, col_order_array, itemCount, column_order_default.c_str( ) ); |
837 | 886 | |
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 | + | |
838 | 899 | const auto res2 = CListCtrl::SetColumnOrderArray( static_cast<int>( itemCount ), col_order_array ); |
839 | 900 | if ( res2 == 0 ) { |
840 | 901 | displayWindowsMsgBoxWithMessage( L"Error in COwnerDrawnListCtrl::LoadPersistenAttributes - SetColumnOrderArray failed!(aborting)" ); |
@@ -924,7 +985,7 @@ public: | ||
924 | 985 | //VERIFY( CListCtrl::SortItems( &_CompareFunc, reinterpret_cast<DWORD_PTR>( &m_sorting ) ) ); |
925 | 986 | |
926 | 987 | HDITEM hditem = { }; |
927 | - auto thisHeaderCtrl = CListCtrl::GetHeaderCtrl( ); | |
988 | + CHeaderCtrl* const thisHeaderCtrl = CListCtrl::GetHeaderCtrl( ); | |
928 | 989 | |
929 | 990 | //http://msdn.microsoft.com/en-us/library/windows/desktop/bb775247(v=vs.85).aspx specifies 260 |
930 | 991 | const rsize_t text_char_count = 260u; |
@@ -1057,7 +1118,7 @@ _AFXCMN_INLINE BOOL CListCtrl::DeleteItem(_In_ int nItem) | ||
1057 | 1118 | //`/analyze` is confused. |
1058 | 1119 | return; |
1059 | 1120 | } |
1060 | - const auto w = COwnerDrawnListCtrl::GetSubItemWidth( item, col ); | |
1121 | + const INT w = COwnerDrawnListCtrl::GetSubItemWidth( item, col ); | |
1061 | 1122 | //_AFXCMN_INLINE int CListCtrl::GetStringWidth(_In_z_ LPCTSTR lpsz) const |
1062 | 1123 | //{ ASSERT(::IsWindow(m_hWnd)); return (int) ::SendMessage(m_hWnd, LVM_GETSTRINGWIDTH, 0, (LPARAM)lpsz); } |
1063 | 1124 |
@@ -1067,6 +1128,7 @@ _AFXCMN_INLINE BOOL CListCtrl::DeleteItem(_In_ int nItem) | ||
1067 | 1128 | width = w; |
1068 | 1129 | } |
1069 | 1130 | } |
1131 | + ASSERT( width >= 0 ); | |
1070 | 1132 | VERIFY( SetColumnWidth_LVM_SETCOLUMNWIDTH( m_hWnd, col, width + 5 ) ); |
1071 | 1133 | //VERIFY( CListCtrl::SetColumnWidth( col, width + 5 ) ); |
1072 | 1134 | } |
@@ -15,7 +15,7 @@ | ||
15 | 15 | |
16 | 16 | #pragma message( "defining `_HAS_EXCEPTIONS 0`..." ) |
17 | 17 | |
18 | -#define _HAS_EXCEPTIONS 0 | |
18 | +//#define _HAS_EXCEPTIONS 0 | |
19 | 19 | |
20 | 20 | #ifndef VC_EXTRALEAN |
21 | 21 |
@@ -147,7 +147,7 @@ | ||
147 | 147 | <IntDir>Release\</IntDir> |
148 | 148 | <LinkIncremental>false</LinkIncremental> |
149 | 149 | <EmbedManifest>false</EmbedManifest> |
150 | - <CodeAnalysisRuleSet>..\WinDirStat.ruleset</CodeAnalysisRuleSet> | |
150 | + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> | |
151 | 151 | <RunCodeAnalysis>true</RunCodeAnalysis> |
152 | 152 | </PropertyGroup> |
153 | 153 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Intel_SSA|Win32'"> |
@@ -169,7 +169,7 @@ | ||
169 | 169 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
170 | 170 | <LinkIncremental>false</LinkIncremental> |
171 | 171 | <EmbedManifest>false</EmbedManifest> |
172 | - <CodeAnalysisRuleSet>..\WinDirStat.ruleset</CodeAnalysisRuleSet> | |
172 | + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> | |
173 | 173 | <RunCodeAnalysis>true</RunCodeAnalysis> |
174 | 174 | </PropertyGroup> |
175 | 175 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Intel_SSA|x64'"> |