Setting Application Name at Runtime

Good Day All

I am trying to figure out if there is a way to change the name that shows in Task Manager after my program has started (or at least as its starting up)

Essentially the concept would be that as they start the program it checks the database name that it is connecting to and adds it onto the end so i can see the difference between
MYProgram-Database1 and MYProgram-Database2 in the task manager.

has anyone done this before and could you give me some pointers on how, where and when to do it?

Just change the title of your primary window - if you’re using MDI that’s the Frame
AppFrame{PROP:Text} = 'MyProgram-Database2'

I just tested what you have shown and it works in the sense that it changes the name of the sub process
for example: Exe name is MYProgram.exe

In Task Manager it shows
MYProgram
MYProgram-Database1

I need the first set to change and the only way i have got this to work so far is by changing the name of the exe itself.

I am wanting to do this for use with Capesoft’s Runonce utility so i can have only one program open per Database but they are all the same base program.

I hope that makes sense

You can change main window’s title:
0{PROP:Text} = 0{PROP:Text} &'-Database1'

That has the same effect as the Appframe.

What i need to be able to change is the first line DrSmashSQL.exe , As this is what Capesofts RunOnce Seems to be Looking at.
AppFrame changes the second line and thus i cant use it to Tell RunOnce to Check and Close it. (unless i have missed something in their documentation)

image

Michael,

I would take a look at the RunOnce template, in particular the application name setting and where/when that is set, maybe you could code before this setting so that RunOnce would see it as a different application.

Perhaps @Bruce might chirp in as this is something I have never done.

Regards

Mark