PowerBuilder Function Get Application Name And Application Path gf_get_name_and_path_application
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Function Name : gf_get_name_and_path_application // Argument Name : (None) // Return Type : String /////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Local External Functions : // Function Long GetModuleFileName (Long hModule, ref String lpFileName, Long nSize) Library 'kernel32.dll' Alias For GetModuleFileNameA ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// String ls_AppPath String ls_FullPath String ls_Exe Integer li_Return Integer li_Pos ls_FullPath = Space (255) li_Return = GetModuleFileNameA (Handle (GetApplication ()), ls_FullPath, 255) If li_Return > 0 Then Do While (Pos (ls_FullPath, "\", li_Pos + 1) > 0) li_Pos = Pos (ls_FullPath, "\", li_Pos + 1) Loop ls_AppPath = Mid (ls_FullPath, 1, li_Pos - 1) ls_Exe = Mid (ls_FullPath, li_Pos + 1) End If Return ls_AppPath |
Good Luck!