Skip to content

Opendocument full mode - #17

Merged
michal-ruzicka merged 4 commits into
mainfrom
opendocument-full-mode
Jul 9, 2026
Merged

michal-ruzicka merged 4 commits into
mainfrom
opendocument-full-mode

Conversation

@michal-ruzicka

Copy link
Copy Markdown
Owner

No description provided.

michal-ruzicka and others added 4 commits July 8, 2026 16:44
Office applications driven via OLE Automation default to
msoAutomationSecurityLow, so a full-mode preview of a macro-carrying
document ran its AutoOpen/Document_Open VBA without any prompt:
automation opens bypass both Protected View and the "Enable Content"
notification bar. The host now sets Application.AutomationSecurity =
msoAutomationSecurityForceDisable on every Word / Excel / PowerPoint
instance it creates, right after CoCreateInstance and before any Open
call, so previews never execute document code in either render mode.

In practice the hole affected XLSB and the legacy DOC / XLS / PPT
formats, where macro capability is invisible in the extension. The
explicitly macro-enabled formats (DOCM, DOTM, XLSM, XLTM, PPTM, PPSM,
POTM) never reach the host at all: Office deliberately registers no
preview handler for them, so the plugin DLL's registry probe declines
the file and Total Commander falls through to its next viewer - the
same behaviour as Explorer's Alt+P pane.

Document the macro guarantees and the no-handler caveat in README.md
(Supported Formats table no longer lists the macro-enabled extensions),
CHANGELOG.md (Security section) and CLAUDE.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Even borderless, the Office window floated over the Lister pane could
be dragged away by the free space of its in-app title bar or resized
by its edges - modern Office hit-tests HTCAPTION and the edge grips in
the client area, so stripping WS_CAPTION|WS_THICKFRAME does not remove
them. An accidental grab (usually while aiming for the Lister's edge)
left the overlay displaced until the pane itself changed.

The overlay tracker now owns the window geometry outright:

- When GetGUIThreadInfo on the Office UI thread reports GUI_INMOVESIZE
  with hwndMoveSize equal to the overlay, the modal move/size loop is
  aborted with WM_CANCELMODE (sent via SendNotifyMessage so the STA
  never blocks on the Office thread). The loop ends as if Esc was
  pressed and the window snaps back to its pre-drag geometry, so the
  grab never takes effect. Drags of the app's own dialogs on the same
  thread are left alone.

- Outside the loop, any mismatch between the overlay's actual rect and
  the pane rect is corrected with the same SetWindowPos the tracker
  already uses, covering drags completed between ticks and programmatic
  self-moves by Office. If Office refuses the rect (minimum-size
  clamp), the failed pane rect is remembered and retried only after the
  pane changes, to avoid fighting Office at the timer frequency.

Also refresh release-date in pluginst.inf.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@michal-ruzicka
michal-ruzicka merged commit ea7cbe3 into main Jul 9, 2026
4 checks passed
@michal-ruzicka
michal-ruzicka deleted the opendocument-full-mode branch July 9, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant