Announcement

Collapse
No announcement yet.

retrieve program name

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Shawn Anderson
    replied
    That worked for me Paul, thanks.

    exe.name$ looked like a class function so I wondered about that.

    thanks everyone!

    Leave a comment:


  • Scott Turchin
    replied
    And...if you think that someone changed the name of the EXE you can always use that code Michael put in the source code forum to draw a string name out of the resource file.

    I updated the code JUST for retrieving a JPEG but you could modify THAT code easy enough to look for "Original filename" or something.

    Leave a comment:


  • Paul Squires
    replied
    EXE.Name$ is new functionality in PBWin9 and PBCC5.

    In order to get the executing filename and extension you would use EXE.Namex$ rather than EXE.Name$

    Leave a comment:


  • Paul Dixon
    replied
    Shawn,
    use the Windows API GetModuleFilename:
    Code:
    #INCLUDE "WIN32API.INC"
    FUNCTION PBMAIN () AS LONG
    LOCAL FullPath AS ASCIIZ * %MAX_PATH
    GetModuleFileName 0, FullPath, %MAX_PATH
    PRINT "Full path:";FullPath
    PRINT " EXE name:";RIGHT$(FullPath, -INSTR(-1,FullPath,"\"))
    WAITKEY$
    END FUNCTION
    Paul.
    Last edited by Paul Dixon; 3 Nov 2008, 02:43 PM.

    Leave a comment:


  • Shawn Anderson
    replied
    Sorry to be ignorant about this, but I seem to missing something. Could you be more specific? I can't find any references to exe.name$, besides references to exe and name separately.

    I'm using PBCC 4.04

    Leave a comment:


  • José Roca
    replied
    With EXE.Name$.

    Leave a comment:


  • Shawn Anderson
    started a topic retrieve program name

    retrieve program name

    How can I retrieve the name (i.e. filename.exe) of a program, from within the program itself?
Working...
X