FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour how to get "Name" of App ?
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
how to get "Name" of App ?
Posted: Sat Apr 15, 2023 06:47 PM
hi,

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

Jimmy
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: how to get "Name" of App ?
Posted: Sat Apr 15, 2023 07:42 PM
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: how to get "Name" of App ?
Posted: Sat Apr 15, 2023 09:13 PM
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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: how to get "Name" of App ?
Posted: Sun Apr 16, 2023 01:42 AM
Code (fw): Select all Collapse
? ExeName()
Regards



G. N. Rao.

Hyderabad, India
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: how to get "Name" of App ?
Posted: Sun Apr 16, 2023 04:06 AM
hi,
nageswaragunupudi wrote:
Code (fw): Select all Collapse
? ExeName()
so there are 3 Solution

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

Jimmy
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: how to get "Name" of App ?
Posted: Sun Apr 16, 2023 10:42 AM

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
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: how to get "Name" of App ?
Posted: Sun Apr 16, 2023 11:35 AM
Thanks mister Rao:
Code (fw): Select all Collapse
      cOrigPath  :=  "C:\DATA\ADDRESS.EXE"
      IF ExeName() <> cOrigPath
         ? "Program name or directory have been changed!"
         QUIT
      ENDIF
Harbour:
Code (fw): Select all Collapse
      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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: how to get &quot;Name&quot; of App ?
Posted: Sun Apr 16, 2023 12:21 PM
We can also get exactly the same result with
Code (fw): Select all Collapse
? HB_ArgV( 0 )
and
Code (fw): Select all Collapse
? GetModuleFileName( GetInstance() )
What to use is just a matter of personal taste.
I use ExeName()
Regards



G. N. Rao.

Hyderabad, India
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: how to get &quot;Name&quot; of App ?
Posted: Sun Apr 16, 2023 12:26 PM
Yes,

https://vivaclipper.wordpress.com/2014/02/26/hb_argv/
Code (fw): Select all Collapse
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
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: how to get &quot;Name&quot; of App ?
Posted: Mon Apr 17, 2023 06:11 AM
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

Continue the discussion