I don't think it's possible, and I think it is a design mistake that we can't know exactly which hwnd or wid the current window has.

There should be an $activewid or something.