1

In the Control Panel applet for customizing tray icons, the application's name is shown. In a WinForms application, this name may be changed with the AssemblyTitle value at compile time, as shown in the image.

enter image description here

Is it possible to change this value at runtime, perhaps with a form property or some other method?

ladenedge
  • 13,197
  • 11
  • 60
  • 117
  • 1
    What are you trying to do? Provide a notification? There are better ways of doing that. Application titles are defined at compile time for good reasons; it doesn't make much sense for an application to say it is something else once it is executed. – Robert Harvey Apr 08 '13 at 19:56
  • I am trying to brand and localize that value. I'd rather it be defined as a configuration option than require me to change my build process. – ladenedge Apr 08 '13 at 20:01

1 Answers1

1

Like you said, the name shown in this dialog is the name of your program as given by the executable file. In the world of .NET, it's exposed as the AssemblyTitle attribute.

But that's read-only at run-time because it gets compiled directly into your executable, both as managed metadata and also unmanaged Win32 resource data. There is no way to change it without recompiling.

So the simple answer to your question is no.

But I really can't figure out what you're trying to accomplish here, much less why. You said this in response to Robert Harvey's question:

I am trying to brand and localize that value. I'd rather it be defined as a configuration option than require me to change my build process.

There is a big difference between a localized resource and a run-time configuration option. You can still localize the value at compile-time, but it will require some changes to your build process. I don't know why this is a big deal if you really need this. Changing your build process one time is way easier than writing and maintaining code that dynamically modifies your executable at run-time.

See these questions for details on how you might set about accomplishing this:

Of course, I'd be remiss if I didn't also point out that localizing the name of your application is a very weird thing to do. If I had an application that was called "Text Editor" in English, I wouldn't want the name to be "Textredigerare" in the Swedish version. That lack of consistency destroys my branding, not improves it. Unless you're creating an operating system with a bunch of utility programs, users know your program by its name. Pick a single name—any language—and stick with it.

Community
  • 1
  • 1
Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
  • "localizing the name of your application is a very weird thing to do": many Windows apps do that... e.g. "Notepad" becomes "Bloc-Notes" in French, "Windows Media Player" becomes "Lecteur Windows Media", etc. Actually there's a way to do it, but it requires the use of Win32 resources; see [this answer](http://stackoverflow.com/a/13755966/98713) for details. – Thomas Levesque Jun 20 '13 at 13:58
  • @Thomas "Unless you're creating an operating system with a bunch of utility programs..." Agreed about using resources to do it, I linked to that same question. – Cody Gray - on strike Jun 20 '13 at 14:37