Special Characters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I often change various messages that are kept in the registry and used by
various programs, e.g. the text displayed by Shell extensions when you
right-click a file or directory. Recently, I have come across "&" in the key
value for the text that is displayed. I am not clear on how to use this, and
what impact it has ...

I discovered this due to a related problem. I downloaded AgentRansack, as
the recent Office 2003 SP3 update somehow has crippled the Windows Explorer
SEARCH function so it only searches through WINNT when I do a date search,
i.e. nothing in file name field. I saw that Agent Ransack displays its
ability in the shell right-click context with "Agent Ransack..." and wanted
to change it to "Search using Agent Ransack...". When I found the only place
in the registry holding the string "Agent Ransack...", it actually held
"&Agent Ransack...". My changing it, to anything else, seems to have no
effect.

So ... I wonder ... is there any place where I can find a catalogue of
registry special characters?

Thanks for any pointers.

P.S. I have searched all over the Web and Microsoft sites, in particular,
for " windows registry special characters", in all combination of quotes and
no quotes:-) Nothing.
 
Sometimes it is used to make the following character underscored and
available using ALT menu.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
 
Dave Patrick said:
Sometimes it is used to make the following character underscored and
available using ALT menu.

David, perhaps my main point wasn't clear: I'm trying to find a reference to
ALL special characters used in the registry. I'm sure Microsoft must have
one, somewhere ... I simply can't find it.

As for the ALT menu thing, I get that ... but it is not the issue here. The
fact is, even changing the text in the data value of the registry key
affected (i.e. from "&Agent Ransack..." to "Search Using &Agent Ransack..."
or " to "&Search Using Agent Ransack..." has no effect. The right-click
action still displays " to "Agent Ransack...".

Hope that helps to get me closer to an answer! Thanks.
 
zagorec said:
... I'm trying to find a reference to ALL special characters used in the registry.
I'm sure Microsoft must have one, somewhere ...

Perhaps not. How do you define "special character"? In what way is a '&' more
"special" than a '@' or a '7' or a 'a'? More likely, each individual character used
as an "operator" to perform some operation is discussed in the section devoted to
the operation it performs.
As for the ALT menu thing, I get that ... but it is not the issue here. The
fact is, even changing the text in the data value of the registry key
affected (i.e. from "&Agent Ransack..." to "Search Using &Agent Ransack..."
or " to "&Search Using Agent Ransack..." has no effect. The right-click
action still displays " to "Agent Ransack...".

I think that only apllies to HKLM\Software\Classes\FileAssociationName\Shell.
Under Shell, you should see a list of action subkeys for the association.
The default value (not the name!) of each subkey is what's displayed in shell
menus. I've found that if you put ampersands or spaces or too many characters
in the subkey names, they don't display right. I keep the subkey names short
and restrict them to letters and underscores.

Example:

Key: Value:
jpegfile <No Name> : REG_SZ : JPEG Image
Shell <No Name> : REG_SZ : open_psp
open_psp <No Name> : REG_SZ : Open in Paint &Shop Pro
... ...

If I keyboard-navigate to a jpg file in Windows Explorer then hit the
"menu" key, I get "Open in Paint Shop Pro" (with the "S" underlined).
If I then hit S, the file opens in PSP. (But since I usually use the mouse,
this is mostly moot.)

As to whether '&' is also used for other things, I don't know.
 
Robbie Hatley said:
Perhaps not. How do you define "special character"? In what way is a '&' more
"special" than a '@' or a '7' or a 'a'?

I don't understand if you're trying to be facetious or you're not really
familiar with any level of programming. If it's the former, I've got a
genuine question, and don't appreciate the side-tracking.

If it's the latter, then know that, by definition, pretty much every
programming language has some group of "meta characters", which are specially
treated in the semantic rules of the language.

For example, in UNIX, there are many special characters, and the "most
special" is a back-slash ("\") whose special meaning is that it makes the
following character literal, and devoid of its special meaning. In DOS, the
"%" is a special character, in that it is used to designate DOS variables.
Etc etc.

I am certain that the Windows registry has a number of such special
characters, and I know that "&" and "%" are both in that category.

What I seek is a delineation of those meta [or "special"] characters, along
with their semantic meanings, so that I can better understand what the
registry is doing.
I think that only apllies to HKLM\Software\Classes\FileAssociationName\Shell.

There's no such key in my registry.

As for the original question, it pertains to the text displayed by Shell
extensions when you right-click a file or directory, not to the ALT menu
thing, which you discuss, and which I said is not the issue here.

And, FYI, the definition of that behaviour (when you right-click a file or
directory) is spread all over the registry, e.g. in my case
HKEY_CLASSES_ROOT\*\shell, HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers,
HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers, etc etc

So, in any case, I'm back to square one ... still looking to understand how
those text strings get munged into what appears on the drop-down when you
right-click a file or directory, and what role "&" plays in all of that.
 
I think your problem is that the registry itself does not make those
characters special (at least the & that you specifically call out). In
most any place where you set the text to be displayed on a Windows
menu, pushbutton, etc., the & makes the following character a hotkey
for that item. In your example of "&Agent Ransack", the & simply
allows you to use <alt>-A to select that item. In most cases, the
interpretation of any "special characters" is up to the application
(or operating system) that interprets them. So it's not likely that
you'll find any one source to explain everything in the registry.

Steve Hendrix
 
Steve said:
I think your problem is that the registry itself does not make those
characters special ...

I'm certain you are correct, Steve, and I would expect such behaviour. So,
if you are able to quote such a precise rule for "&", I'm guessing there are
equally precise rules for other characters (e.g. I've seen "\?" and "\??\",
and pretty much everybody knows what "%thing%" is for)! I.e. there is likely
some correspondence of special characters injected into the registry and the
interpretation of those by the apps that use them.

That's what I've really been trying to ask, and THANK YOU for helpng me
grapple with how to clarify the question.

BTW, what really mystified me, and got me to asking this question, was that
I thought another comment you were making is true, i.e. ...
... In your example of "&Agent Ransack", the & simply
allows you to use <alt>-A to select that item.

Well, it turns out that NO MATTER what I put after the "&", the text
displayed in the Explorer right-click is THE SAME! I.e. I changed the key
value "&Agent Ransack" to be "&What the heck" ... and yet the right click
still showed "Agent Ransack" in the selection list! There was no instance of
"what the heck"!

Yet, for other keys that I have modified in this regard, I get the behaviour
I expect (and want).

Peculiar!

Thanks again for the clarification ... maybe somebody will now provide a
pointer?!
 
\\?\ is a unicode function to permit passing a length of approximately
32,000 characters to the operating system.


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
 
Back
Top