//取得应用程序所在路径
FUNCTION boolean GetModuleFileNameA(long apphandle,ref string pathname, long len) LIBRARY "Kernel32.dll"
//查找应用程序所在路径
int li_len
boolean suc
long apphandle
string position
position=space(500)
apphandle=handle(getapplication())
suc=GetModuleFileNameA(apphandle,position,500)
if suc then
for li_len=len(position) to 1 step -1 //过滤掉应用程序名
if mid(position,li_len,1)='~\' then exit
next
position=left(position,li_len)
end if