Page 1 of 1

how to get "Name" of App ?

PostPosted: Sat Apr 15, 2023 6:47 pm
by Jimmy
hi,

under Xbase++i have AppName() to get "Name" of App
how under Fivewin :?:

Re: how to get "Name" of App ?

PostPosted: Sat Apr 15, 2023 7:42 pm
by karinha

Re: how to get "Name" of App ?

PostPosted: Sat Apr 15, 2023 9:13 pm
by Jimmy
hi,

thx for Answer

the Link point to
How to keep a appl. on top of the dlg on resize ? (solved)


---

i got 2 Solution
1.) GetModuleFileName( GetInstance() )
2.) GetAppName()
where 2nd point to 1St

Re: how to get "Name" of App ?

PostPosted: Sun Apr 16, 2023 1:42 am
by nageswaragunupudi
Code: Select all  Expand view
? ExeName()

Re: how to get "Name" of App ?

PostPosted: Sun Apr 16, 2023 4:06 am
by Jimmy
hi,
nageswaragunupudi wrote:
Code: Select all  Expand view
? ExeName()

so there are 3 Solution

... "where" is ExeName() ... can´t find it under \fwh :?:

Re: how to get "Name" of App ?

PostPosted: Sun Apr 16, 2023 10:42 am
by nageswaragunupudi
This is a function from Clipper Tools functions, available from the good old Clipper days.
This is available in CT.LIB for xHarbour and hbct.lib for Harbour.
This lib is automatically linked in build?..

Please note that this returns the exename with full path.

Re: how to get "Name" of App ?

PostPosted: Sun Apr 16, 2023 11:35 am
by karinha
Thanks mister Rao:

Code: Select all  Expand view

      cOrigPath  :=  "C:\DATA\ADDRESS.EXE"
      IF ExeName() <> cOrigPath
         ? "Program name or directory have been changed!"
         QUIT
      ENDIF
 


Harbour:

Code: Select all  Expand view


      cOrigPath  :=  "C:\DATA\ADDRESS.EXE"
      IF HB_ProgName() <> cOrigPath
         ? "Program name or directory have been changed!"
         QUIT
      ENDIF
 


Regards, saludos.

Re: how to get "Name" of App ?

PostPosted: Sun Apr 16, 2023 12:21 pm
by nageswaragunupudi
We can also get exactly the same result with
Code: Select all  Expand view
? HB_ArgV( 0 )

and
Code: Select all  Expand view
? GetModuleFileName( GetInstance() )


What to use is just a matter of personal taste.
I use ExeName()

Re: how to get "Name" of App ?

PostPosted: Sun Apr 16, 2023 12:26 pm
by karinha
Yes,

https://vivaclipper.wordpress.com/2014/02/26/hb_argv/

Code: Select all  Expand view

Example:

      // If command line is :  C:\temp>test.exe p1 p2

        ? HB_ArgV()     // C:\temp\test.exe
        ? HB_ArgV( 0)   // C:\temp\test.exe
        ? HB_ArgV( 1 )  // p1
        ? HB_ArgV( 2 )  // p2
        ? HB_ArgV( 3 )  // ( Null String )
 


Regards, saludos.

Re: how to get "Name" of App ?

PostPosted: Mon Apr 17, 2023 6:11 am
by Jimmy
hi,
nageswaragunupudi wrote:This is a function from Clipper Tools functions, available from the good old Clipper days.
This is available in CT.LIB for xHarbour and hbct.lib for Harbour.

ahh, i begin to remember ...

thx for Answer