Archive: Ampersand in Application Name


Ampersand in Application Name
My application name has an ampersand (&) in the name (such as 'A & Z'). The problem is that some windows controls & labels interpret the ampersand as the hotkey character indicator. The name shows up fine in the caption bars and text boxes, but most or all of the labels are incorrect (there might have been a few labels that displayed properly, I cant remember). As a result, I get an underlined space that look kinda like 'A _B'

I found out that I could custom specify some of the text for certain strings (ex: using the DirText option) to escape the ampersand (ie: 'A && Z') . I got everything hacked in like this, except for the text that appears in the background window. I looked at the docs, but I couldnt find any option to specify the text for the background window. I tried looking through the source to see if there was somewhere I could change this behavior, but I couldnt find where in the source code this would need to be done.

Can anyone suggest a way I could fix this (other than using notext to remove the background text, or changing the name to 'A and B', neither of which I want to do).


Of course, as soon as I ask, I figure it out myself.

For the background, I had to modify the bgbg.c file for the exehead project and rebuild. The change I made was to add the DT_NOPREFIX flag to the DrawText call. I also made the same change in ui.c, but I'm not sure what effect that had.

Also, so that I didnt have to hack it, I went into the resource file (resource.rc) edited all of the dialogs, and made sure the static text labels all had the "No Prefix" option enabled. No more need to use && to escape it.

Sorry I posted for nothing, but hopefully this will help someone else.