Nope, in general terms. To start with, GUI programs don't work that way usually. It would be a complete nonsense and a waste of resources. Programs use system calls, code contained within libraries like libc or whatever is applicable to the language.
In C, for example, you would use opendir() or a similar function.
You can use something like strace, though. That will show you a lot of info about what the program is doing. You have to know how to read it though.