how to get "Name" of App ?

Post Reply
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

how to get "Name" of App ?

Post by Jimmy »

hi,

under Xbase++i have AppName() to get "Name" of App
how under Fivewin :?:
greeting,
Jimmy
User avatar
karinha
Posts: 7932
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: how to get "Name" of App ?

Post by karinha »

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: how to get "Name" of App ?

Post 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
greeting,
Jimmy
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: how to get "Name" of App ?

Post by nageswaragunupudi »

Code: Select all | Expand

? ExeName()
Regards

G. N. Rao.
Hyderabad, India
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: how to get "Name" of App ?

Post by Jimmy »

hi,
nageswaragunupudi wrote:

Code: Select all | Expand

? ExeName()
so there are 3 Solution

... "where" is ExeName() ... can´t find it under \fwh :?:
greeting,
Jimmy
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: how to get "Name" of App ?

Post 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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
karinha
Posts: 7932
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: how to get "Name" of App ?

Post by karinha »

Thanks mister Rao:

Code: Select all | Expand

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

Code: Select all | Expand


      cOrigPath  :=  "C:\DATA\ADDRESS.EXE"
      IF HB_ProgName() <> cOrigPath
         ? "Program name or directory have been changed!"
         QUIT
      ENDIF
 
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
nageswaragunupudi
Posts: 10721
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 8 times
Contact:

Re: how to get "Name" of App ?

Post by nageswaragunupudi »

We can also get exactly the same result with

Code: Select all | Expand

? HB_ArgV( 0 )
and

Code: Select all | Expand

? GetModuleFileName( GetInstance() )
What to use is just a matter of personal taste.
I use ExeName()
Regards

G. N. Rao.
Hyderabad, India
User avatar
karinha
Posts: 7932
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Been thanked: 3 times
Contact:

Re: how to get "Name" of App ?

Post by karinha »

Yes,

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

Code: Select all | Expand

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.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: how to get "Name" of App ?

Post 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
greeting,
Jimmy
Post Reply