frame-list returns a list of references for live Emacs frames. How does one get a reference for the current Emacs frame? I have been unable to find an appropriate function. Current could be either (1) the Emacs frame that has focus (one or zero references) or (2) the Emacs frame that last had focus.
I'm presently looking to use (1) under w32, but for didactic purposes I'm interested in both and whether there are any caveats for focus tracking in Emacs.