how to get "Name" of App ?

how to get "Name" of App ?

Postby Jimmy » Sat Apr 15, 2023 6:47 pm

hi,

under Xbase++i have AppName() to get "Name" of App
how under Fivewin :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: how to get "Name" of App ?

Postby karinha » Sat Apr 15, 2023 7:42 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: how to get "Name" of App ?

Postby Jimmy » Sat Apr 15, 2023 9: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
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: how to get "Name" of App ?

Postby nageswaragunupudi » Sun Apr 16, 2023 1:42 am

Code: Select all  Expand view  RUN
? ExeName()
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: how to get "Name" of App ?

Postby Jimmy » Sun Apr 16, 2023 4:06 am

hi,
nageswaragunupudi wrote:
Code: Select all  Expand view  RUN
? ExeName()

so there are 3 Solution

... "where" is ExeName() ... can´t find it under \fwh :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: how to get "Name" of App ?

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: how to get "Name" of App ?

Postby karinha » Sun Apr 16, 2023 11:35 am

Thanks mister Rao:

Code: Select all  Expand view  RUN

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


Harbour:

Code: Select all  Expand view  RUN


      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
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: how to get "Name" of App ?

Postby nageswaragunupudi » Sun Apr 16, 2023 12:21 pm

We can also get exactly the same result with
Code: Select all  Expand view  RUN
? HB_ArgV( 0 )

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


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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10656
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: how to get "Name" of App ?

Postby karinha » Sun Apr 16, 2023 12:26 pm

Yes,

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

Code: Select all  Expand view  RUN

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
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: how to get "Name" of App ?

Postby Jimmy » Mon Apr 17, 2023 6: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
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 31 guests