Commit Graph

223 Commits

Author SHA1 Message Date
Johnny Shaw eea3b085cd treenew fix stack overflow inserting nodes of very deep trees 2026-09-02 19:04:55 -06:00
Johnny Shaw 39493fa785 treenew fix touch scroll with custom scrollbars 2026-08-31 01:15:04 -06:00
dmex 15ec45a121 Update copyright year 2026-07-01 01:43:30 +10:00
dmex 46ca06a44d Update treenew.c 2026-06-21 15:51:07 +10:00
dmex d0e38a1377 Suppress scroll anchoring during thumb drag
Add VScrollThumbTracking so anchoring logic doesn't fight a user dragging the scrollbar thumb. PrepareVScrollAnchor now returns early if the thumb is being tracked.
2026-06-21 13:22:11 +10:00
dmex 05200ae6d4 Optimize treenew layout and painting cache
Introduce a layout geometry cache to avoid redundant MoveWindow/SetWindowPos/TTM_NEWTOOLRECT calls: add cache fields to the context and PhTnpInvalidateLayoutCache(), and call it on font/settings/theme/DPI changes. Replace per-row CreateRectRgn/GetClipRgn/DeleteRgn with a single SaveDC/RestoreDC bracket in PhTnpPaint to eliminate O(N) kernel region allocations during WM_PAINT. Other changes: update scrollbars, add a small stack buffer optimization for column reorder arrays, use SWP_NOOWNERZORDER when positioning tooltips, and minor formatting/fixes in layout and notify handling.
2026-06-20 02:14:11 +10:00
dmex f6aba94465 Add WindowDpi to treelist draw struct 2026-05-11 10:15:21 +10:00
dmex 9467d5f646 Improve DPI handling, icon scaling, metrics (#2894) 2026-05-02 09:13:06 +10:00
dmex 45674465a1 Use lookup for columns and defer redraw updates 2026-04-17 03:30:07 +10:00
dmex b0e373d10f Fix scrolling, column indexing and layout bugs
Fixes HScrollVisible when computing HScrollHeight; correctly handle fixed column indexing when copying columns (return fixed column for index 0 and adjust lookup); fix centered text rectangle calculation to use TextRect.left + width; and adjust PhTnpEnsureVisibleNode call to pass the focused node index (remove off-by-one). These changes correct visual/layout issues and off-by-one errors when interacting with columns and node focus.
2026-04-13 11:42:23 +10:00
dmex 5d4428adbf Add scroll anchoring to treenew
Introduce scroll-anchoring support to the treenew control: add explanatory comments and anchoring behavior. Define anchor-related macros and declare helper APIs (PhTnpGetMaxVScrollPosition, PhTnpFindFlatListNode, PhTnpPrepareVScrollAnchor, PhTnpGetAnchoredVScrollPosition) used to snapshot/restore viewport during structural updates to avoid visible jumps.
2026-04-09 16:14:05 +10:00
dmex 3a66e4d7e1 Fix rare crash from Win32k bug during SetWindowPos
Remove SWP_HIDEWINDOW in SetWindowPos calls, adding SWP_NOZORDER instead. This keeps the tooltip from being forced topmost or explicitly hidden when it's already topmost and processing show messages - Fix rare crash from win32k https://learn.microsoft.com/en-us/windows/win32/controls/implement-in-place-tooltips
2026-04-04 11:48:12 +11:00
dmex 98032e6a56 Add selection bitmap caching 2026-03-25 05:35:06 +11:00
dmex 98d479b45e Update treenew documentation 2026-01-07 05:59:44 +11:00
dmex 8409699e04 Add minor fixes for testing 2025-12-13 16:02:52 +11:00
dmex ae18746560 Remove release assert 2025-09-28 04:08:35 +10:00
dmex 927dbde82f Add TNM_GETCELLPARTS 2025-09-23 08:49:10 +10:00
dmex b1e2fa1a6c Add treenew support for drag-reorder nodes 2025-09-22 20:02:49 +10:00
dmex b5c67d07f9 Add TreeNew_SelectFirstVisibleNode and some missing macros 2025-09-22 19:34:00 +10:00
dmex b6a08bfeaa Update SAL Annotation 2025-09-08 16:21:27 +10:00
dmex 5423ff7cfb Merge dev branch fixes (#2680) 2025-09-07 05:06:34 +10:00
Johnny Shaw 14de41e462 phnt fix assert defines 2025-08-31 14:08:46 -06:00
dmex 89ddbfb072 Fix build 2025-08-20 12:13:11 +00:00
dmex 6c20c78fb6 Merge minor fixes from dev branch 2025-08-20 11:54:19 +00:00
dmex 7d61d85c69 Tidy up window procedure 2025-04-03 09:13:23 +11:00
dmex 2afa7fce00 Silence SAL annotation 2025-04-03 07:50:35 +11:00
dmex b8b92c246a Fix treelist scrollbar visibility cache 2025-03-12 15:52:35 +11:00
dmex ffb411c27b Disable DPI scaling of treelist and lsitview items for Windows 7/8 (#2424) 2025-03-11 11:57:36 +11:00
dmex 87edd6e69a Fix treenew column dpi scaling 2025-03-11 06:14:25 +11:00
dmex 08f4629755 Improve treenew performance by caching DPI padding 2025-02-13 21:20:08 +11:00
dmex a1b40b530b Update to the latest SDK 2024-12-31 22:56:12 +11:00
dmex bfc7a93c56 Fix null reference during cleanup 2024-12-13 12:29:38 +11:00
dmex 13728d0da1 Fix header bitmap cleanup 2024-12-07 10:08:05 +11:00
dmex 64555b04a2 Add TreeNew_GetSelectedNode 2024-11-30 05:36:36 +11:00
Dart Vanya 504d941e18 Object Manager Plus (#2197)
* Implement properties support for Object Manager

- Standard System Informer handle properties window for Windows objects (including Directories).
- Add support for missing object types: Device, EventPair, Timer, Semaphore, FilterConnectionPort
- Add target link info for Symbolic links
- Fix Directory handles leaking

* Enhanced Object Manager

- Add Windows Object tab to properties window: object attributes and creation time.
- Add GeneralCallbackHandlePropertiesWindowPreOpen, calls on WM_INITDIALOG and allows plugins to customize general handle properties tab.
-- Display real handles count and hide irrelevant access entry (EtHandlePropertiesWindowPreOpen).
- Add Symbolic Link Target column
- Enhanced navigation to symlink: focus to target in ListView.

* Fix bug

* Center properties window to ObjMgr window

* Defied WinObj: search, statusbar, refresh

- Implements search using standard SI searchbox: searches all 3 columns (name, type, symlink)
- Status bar (pseudo) with fullpath to selected object (can copy on righclick menu), current directory object count
- Refresh button - full rebuild of tree and current dir list
- Get object address using KSI (previous commit)

* Fix memory leaks and violations + other improvements

- I finally understand how PH memory management works and fixed (hope) horrible previous code.
- Fixed WM_KEYDOWN forwarding (both for PH and plugins), broken by 5bf7f29
- F5 - refresh, filter will be reapplied after refresh
- Autosizing of Name column on window resizing. Plugin properties window position will not overwrite generic handle propertines window position setting.

* Fix directory security bug

* Fix directory security bug

* Speedup search

* Show File info for Device and FilterConnectionPort

* Fix pool table auto refresh

Broken by 0c0c938

* Minor refresh fixes

* Add target resolving for Device and ALPC port

- Renamed Symbolic Link Target column to Target
- Implemented (experimental) asynchronous resolver for Device and ALPC port targets.
-- Resolving Device driver target. Added menu Go to device driver
-- Resolving ALPC server process target. Added menu Go to server process
- Rewritten navigaton to symbolic links (and device drivers)

* Add target resolving for Mutant, fix search

- Improve resolver. Added mutant client owner to target and menu Go to thread...
- Improve filter: it now stay when changing directory. If selected entry match it stay selected and visible when performing search.
- Tri-state column sort now saved and loaded from settings (ObjectManagerWindowListSort). Sort now works correctly on directory or filter change.
- Enter - open properties, Shift+Enter - open security, Shift+Dblclk on symlink opens its properties.

* Create resolver thread by NtCreateThreadEx

* Support for open symlink target in explorer

* Show Job process list in target column

* Fix TriState sort, add "Reset sort" context menu

* Add CpuPartition type support and icons for more types

- Add icon for Job, Semaphore, FilterConnectionPort, CpuPartition

* Fix open of Device object in root directory

* Add MemoryPartition icon

* New Object Handles page in properties

- Old Windows Object page entries moved to general page in "Basic information" block. Windows Object replaced with Handles page.
- Menu - Go to process... supported
- Now opens real ALPC port object using new method (thx to https://github.com/zodiacon/ObjectExplorer)
- Show additional handles for ALPC Port, File, Key (match by object name). Extra entries will be highlight with ColorInheritHandles)

* [SI] Advanced options - add menu Reset

- Fix dark theme for new choose dialog

* Add PhOpenDevice. ObjMgr Plus FINAL

- My first attempt in kernel programming. Add PhOpenDevice -> KphOpenDevice. Open Device object handle and optional Device Driver handle.
- Propertines - Device driver info: show topmost and lowest drivers in stack
- Directory list: allow multiselect, Ctrl+A, Ctrl+C support. Menu Copy Full Name (for list and tree).
- [Theme] ListVew: fix text readability for hot and selected colored items.
TreeNew:  significantly improve visibility of selected item.

* Fix build

* Fixed Ctrl+K to search box in PE VIew

* Open more object types when driver is disabled

* Support for multiple non-modal object properties windows

- Change PhShowHandlePropertiesModal -> PhShowHandlePropertiesPlugin. Add GeneralCallbackHandlePropertiesUninitializing
- Save and load properties window position to/from ObjectManagerPropertiesWindowPosition setting
- Resolving of Driver Image into Target column. Show Driver Image in properties.

* Add KphOpenObjectByTypeIndex

- [Experimental]. Can open any object types like Callback, Type, etc.
- New icons for Callback, KeyedEvent, Type, Semaphore

* Handles page: add menu - properties, menu - close

- Replace PID column with Attributes. Highlight entries with color corresponding to attribute
- Save last selected directory to ObjectManagerLastPath
- Set properties window icon to listview
 object type icon. Add timer icon

* Show extended Type information in properties (works also without KSI)

* Fixed closing modeless property sheet from taskbar

- Add WindowStation icon, additional type info in Target
- Add WindowStation visibility info in properties (ET general, for all handle dialogs).

* Update SDK

* [ET] Add Desktops page to WindowStation properties

- [ET] Show Desktop information in general properties page
- General prop sheet - hide OK button, rename Cancel -> Close. Suppress closing dialog by Enter press

* Improve object handles enumeration without KSI

- Added found handles counts: Total, By address, By name/By type
- Show all handles of same type as Type object on its Handles page

* General improve of resolver speed via worker queue

- Resolve PDO name for Device if driver name cannot be resolved.

* Fix theme for plugins' pages trees

* Fix bug

* Show Original name in Object prop -> Handles -> Prop window

* WindowStation - Desktops page - add menu - Security

* Bring back OK button in service properties

- Show Device target in format: [driver_upper] [->] [driver_low]
- New menu: Go to upper driver, Go to lower driver

* Bring back OK button in service properties

- Show Device target in format: [driver_upper] [->] [driver_lower]
- New menu: Go to upper driver, Go to lower driver

* Theme fixes and enhancements

- Advanced options menu Reset added

* Full DarkMode support for TaskDialog

Credits to https://github.com/SFTRS/DarkTaskDialog
- Highlighting and Graph colors: menu - Reset added
- Fix drawing of disabled ListView in dark theme
- SysLink theme support (call PhInitializeSysLinkTheme to apply to control)

* Minor fixes

- Removed ListView subclass
- Add options: EnableThemeAnimation (default 1), EnableThemeNativeButtons (default 0)

* Security page CHECKLIST_ACLUI checks theme support

* Transit from PhShow(Error|Warning|Information) to PhShow(Error|Warning|Information)2

* Public PhThemeWindowDrawButton: tristate checkbox, radio, multiline

- Fix the annoying white border what remained from the previous active control in CHECKLIST_ACLUI
- ExtendedServices: MessageBox to TaskDialog transit

* Better ListView theme (OpenNcThemeData hook)

* New SysLink coloring method via IAT hook

- Remove PhInitializeSysLinkTheme

* Small fixes

* Requested changes

* Requested changes

* Fix SysLink theme support on Windows 10

- TaskDialog theme on Windows 10 currently unsupported...

* Transition to PhQuerySymbolicLinkObject

- Fix SymbolicLink target in handle properties

* Transit to new driver APIs

- Object Handles tab: added support for changing handle attributes
- ET plugin extensions now available for Driver, Device, Type (globally for any handle properties windows)

* rebase filter APIs

* new KphQueryInformationObject KphObjectAttributesInformation

- Extract information from more kernel objects using new method (ex. \PowerPort, \Win32kCrossSessionGlobals)
- Retrieve extra object attributes from OBJECT_HEADER.Flags via driver
- Show additional Driver info: Service Name, Size, Start Address, Flags

---------

Co-authored-by: dmex <dmex04@gmail.com>
Co-authored-by: Johnny Shaw <johnny.shaw@live.com>
2024-11-14 19:41:31 -07:00
ge0rdi 8255bb904e Few improvements (#2257)
* fix Ctrl+K (search box) handling

- tree view didn't pass keypresses to parent window so it was not
  possible to handle the keyboard combo
- some plugins didn't handle Ctrl+K at all

Fixes #2241

* treenew handle Ctrl+A in common code

* searchbox pressing escape will abandon search

Current search is abandoned and focus is returned to window that
previously had it, instead of closing whole dialog.

* fixup! searchbox pressing escape will abandon search

* Update SystemInformer/searchbox.c

Co-authored-by: Johnny Shaw <johnny.shaw@live.com>

* Update SystemInformer/searchbox.c

---------

Co-authored-by: Johnny Shaw <johnny.shaw@live.com>
2024-10-29 19:04:04 -06:00
dmex 2ee7995062 Update treenew.c 2024-10-17 13:26:58 +11:00
dmex dee562e383 Update to latest SDK 2024-10-03 22:29:54 +10:00
dmex 62ebd16573 Fix regression header commit c87d3e67bc 2024-10-03 21:44:29 +10:00
dmex c87d3e67bc Update to latest SDK 2024-09-22 12:58:26 +10:00
dmex d4a3ecea12 Improve custom treelist header hot tracking 2024-09-12 10:56:36 +10:00
dmex 8c3c84da9c Improve custom treelist header drawing 2024-09-12 10:43:53 +10:00
dmex de6d1c9c11 Update to latest SDK 2024-09-09 07:33:45 +10:00
dmex 92bd0805c5 Add TreeNew_GetVisibleColumnArray 2024-06-25 02:10:58 +10:00
dmex 1375429a90 Update to latest SDK 2024-06-23 05:49:26 +10:00
dmex 04b3911f85 Update types for latest SDK 2023-09-11 02:47:46 +10:00
dmex f57de03aea Update SAL annotations 2023-07-09 00:25:40 +10:00
dmex e2ad659d6a Add treenew parentdc style and fix treenew font startup metrics 2023-06-08 07:52:33 +10:00
dmex 65bf4b7b7f Fix regression from commit 90df78e2 2023-05-27 15:45:18 +10:00
dmex 681afb3a0b Update treenew headers, cursors and SAL annotations 2023-05-23 22:41:25 +10:00