Is there any way, given an arbitrary UI button*'s label text, or GUI entity's pointer/handle, to programmatically determine the command it triggers? Only care about the main UI buttons managed by the Menu Editor, not asking about any/all arbitrary UI controls. Oh, and asking w.r.t. LW2015 (and prior, ideally), LW2018-only approaches aren't useful for my needs.

Parsing config file contents won't work because "default" assignments don't show up in there.