Globally visible functions are functions defined in the global namespace. Most of the functions that appear in system header files and all C functions appear in the global namespace.
However, you can define functions of the same name (overload) in a namespace or a class. If you're in a class and your class has a function with the same name as a global one, you have to use :: to make it clear the to compiler that mean to invoke the global one, otherwise you'll get the one closest (in scope) to you.
In your example, if your class didn't have a method called GetTopWindowID, you wouldn't need ::