중국어로 된 프로그램을 돌리려다보니 글자가 깨져서 예전에 사용해 보았던 Applocale을 설치했습니다.
그런데 편리하게 우측 콘텍스트 메뉴에 등록해 주는 것까진 좋았지만 여러개가 동시에 등록되니
지저분하고 쓸데없이 긴 메뉴가 되어버려서 계단식 콘텍스트 메뉴(Cascading Menu)로 개조해 보기로 했습니다.
계단식 메뉴를 만들기 위해서 우선 구글에서 검색되는 MSDN의 문서를 참조했습니다.
( https://msdn.microsoft.com/en-us/library/cc144171%28v=VS.85%29.aspx )
이 문서는 SubCommands 또는 ExtendedSubCommandsKey를 사용하는 2가지 방법을 알려줍니다.
이 중 SubCommands는 따로 CommandStore에 등록해 주어야 하는데 다른데서 이 것을 가져다 사용할 일은 전혀 없으니,
윈7 이상만 지원하지만 명령어 아래 바로 등록이 가능한 ExtendedSubCommandsKey를 사용하는 방법을 택하기로 하였습니다.
그런데 아무리 이리저리 고쳐봐도 메뉴가 생기지 않습니다.
결국 다시 구글링을 하다보니 한 사이트의 답변을 찾게 되었습니다.
답변한 분은 MSDN의 정보는 잘못된 것으로 ExtendedSubCommandsKey는
SubCommands와 마찬가지로 키가 아닌 문자열값(REG_SZ)이라는 것이었습니다.
( https://groups.google.com/forum/#!topic/comp.os.ms-windows.programmer.win32/6HrSIMdFRCk )
잠시 황당했지만 그곳에서 예시로 들어준 사이트에 나온데로 문자열값으로 생성 후
값을 메뉴를 만들 하위 키로 지정했더니 드디어 완벽하게 메뉴가 만들어졌습니다.
( http://io-repo.blogspot.de/2011/05/cascading-context-menus-via-static.html )

HKEY_CLASSES_ROOT
exefile
shell
Applocale
MUIVerb = Run with Applocale
ExtendedSubCommandsKey = exefile\shell\Applocale\cmd
cmd
shell
cmd1
MUIVerb = Run with &Chinese (Simplified) locale
command
기본값 = C:\Windows\AppPatch\AppLoc.exe "%1" "/L0804
cmd2
HasLuaShield =
MUIVerb = Run with &Chinese (Simplified) locale as administrator
command
기본값 = C:\Windows\AppPatch\AppLocA.exe "%1" "/L0804
...
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\exefile\shell\Applocale]
"MUIVerb"="Run with Applocale"
"ExtendedSubCommandsKey"="exefile\\shell\\Applocale\\cmd"
[HKEY_CLASSES_ROOT\exefile\shell\Applocale\cmd]
[HKEY_CLASSES_ROOT\exefile\shell\Applocale\cmd\shell]
[HKEY_CLASSES_ROOT\exefile\shell\Applocale\cmd\shell\cmd1]
"MUIVerb"="Run with &Chinese (Simplified) locale"
[HKEY_CLASSES_ROOT\exefile\shell\Applocale\cmd\shell\cmd1\command]
@="C:\\Windows\\AppPatch\\AppLoc.exe \"%1\" \"/L0804\""
[HKEY_CLASSES_ROOT\exefile\shell\Applocale\cmd\shell\cmd2]
"HasLuaShield"=""
"MUIVerb"="Run with &Chinese (Simplified) locale as administrator"
[HKEY_CLASSES_ROOT\exefile\shell\Applocale\cmd\shell\cmd2\command]
@="C:\\Windows\\AppPatch\\AppLocA.exe \"%1\" \"/L0804\""
[HKEY_CLASSES_ROOT\exefile\shell\Applocale\cmd\shell\cmd3]
"MUIVerb"="Run with &Chinese (Traditional) locale"
[HKEY_CLASSES_ROOT\exefile\shell\Applocale\cmd\shell\cmd3\command]
@="C:\\Windows\\AppPatch\\AppLoc.exe \"%1\" \"/L0404\""
[HKEY_CLASSES_ROOT\exefile\shell\Applocale\cmd\shell\cmd4]
"HasLuaShield"=""
"MUIVerb"="Run with &Chinese (Traditional) locale as administrator"
[HKEY_CLASSES_ROOT\exefile\shell\Applocale\cmd\shell\cmd4\command]
@="C:\\Windows\\AppPatch\\AppLocA.exe \"%1\" \"/L0404\""
[HKEY_CLASSES_ROOT\exefile\shell\Applocale\cmd\shell\cmd5]
"MUIVerb"="Run with &Japanese locale"
[HKEY_CLASSES_ROOT\exefile\shell\Applocale\cmd\shell\cmd5\command]
@="C:\\Windows\\AppPatch\\AppLoc.exe \"%1\" \"/L0411\""
[HKEY_CLASSES_ROOT\exefile\shell\Applocale\cmd\shell\cmd6]
"HasLuaShield"=""
"MUIVerb"="Run with &Japanese locale as administrator"
[HKEY_CLASSES_ROOT\exefile\shell\Applocale\cmd\shell\cmd6\command]
@="C:\\Windows\\AppPatch\\AppLocA.exe \"%1\" \"/L0411\""
[HKEY_CLASSES_ROOT\exefile\shell\Applocale\cmd\shell\cmd7]
"MUIVerb"="Run with &Korean locale"
[HKEY_CLASSES_ROOT\exefile\shell\Applocale\cmd\shell\cmd7\command]
@="C:\\Windows\\AppPatch\\AppLoc.exe \"%1\" \"/L0412\""
[HKEY_CLASSES_ROOT\exefile\shell\Applocale\cmd\shell\cmd8]
"HasLuaShield"=""
"MUIVerb"="Run with &Korean locale as administrator"
[HKEY_CLASSES_ROOT\exefile\shell\Applocale\cmd\shell\cmd8\command]
@="C:\\Windows\\AppPatch\\AppLocA.exe \"%1\" \"/L0412\""
그런데 MSDN의 잘못된 공식자료가 저렇게 오래 방치되는 것이 놀랍습니다.;;