Menu ▾ ▴

#4 DIALOGS does not report the text of task dialogs

open
nobody
None
4 hours ago
4 hours ago
No

DIALOGS lists a message box's buttons and its text. For some boxes it lists only the OK button and no text at all, so what the box says cannot be read. Seen with an IDE error box on top of a file dialog; the file dialog behind it listed its text normally.

Cause: such a box is a task dialog, a #32770 whose whole content is one DirectUIHWND. The text is drawn by DirectUI and has no window of its own. The only child windows are a Button, two SysLinks and four ScrollBars, all but the button hidden. So there is no static to read, and no filter to loosen.

The only ways to reach DirectUI text are UI Automation (IUIAutomation) or IAccessible via AccessibleObjectFromWindow. That would be a COM dependency in a unit that otherwise needs nothing but the VCL, and Delphi 7 has no import unit for it.

DISMISS does not need the text, since it reports what became of the click by itself. So this is only worth doing if reading such a box is actually needed.

Discussion


Log in to post a comment.