Add function to get main window handle

Handle is needed in CJoystickInterfaceDirectInput when enumerating joysticks.
Handle is only needed once and doesn't depend on any local or member
variables.

Implementation is from https://stackoverflow.com/questions/6202547/win32-get-main-wnd-handle-of-application