How do I ascertain the function code associated with a push button or a menu item?

By default every push button and menu item is associated with a function code. Set the focus to the push button that you are interested in. If it is a menu item, simply highlight the menu item (do not click the menu item). Now point your mouse cursor to highlighted (or focused) item and click on F1. The popup window will show a function code.

Alternatively, you can turn on Input Recording and click the push button or menu item. The Input Recorded will record the function code for you.