Boris,
If you simply want to know if you are Runtime vs. inside VFP use version(2). If you want to know the folder that the app is located in it's a little bit of work on my website in the spyin.zip file the help file and code show one way of doing it.
>I must know where is my application is running from. What function (built in or Win32Api) I must call to find out the desire thing.