..
	
		
			
			
			
	
	
		
2025/01/29
	多くのコードが必要になってきたため,ひとまず中断.
		RegFType.?xx は,RSFType.hpp として書き換え.
			クラス名は RegFileType から RFileType に.
			レジストリのアクセスに関しては,RegAccess から REG_key を使用したものに書き換え.
				但し,途中のため REG_Access を挟んだものにしているのと,REG_rsft としている.
		使用する時 #define	_REG_rsft_ とすることにより,REG_rsft.hpp と RSFType.hpp だけの利用となる.
			定義されていない場合は,REG_rsft.hpp は使われず RI_REG.hxx の方になる.
			_REG_rsft_ を定義しているプロジェクト	・・・	rsftM ,rsftS 
			RSFType.hpp で実装したプロジェクト  	・・・	MBPV
2025/01/28
	HKCR に書けない(管理者権限で起動していない)場合は,HKCU\Software\Classes\ 以下の同じ所に書き込む
		HKEY_CLASSES_ROOT \\                      .ext
		HKEY_CURRENT_USER \\ Software\\Classes\\  .ext
		MS HKEY_CLASSES_ROOT キー
	CDocManager::RegisterShellFileTypes での登録内容
		.ext
			@="---.Document"
		.ext\ShellNew
			"NullFile"=""
		---.Document
			@="---.Document"
		---.Document\DefaultIcon
			@="C:\---\---.exe,1"
		//	SDI
		---.Document\shell\open\command
			@="C:\---\---.exe \"%1\""
		---.Document\shell\print\command
			@="C:\---\---.exe /p \"%1\""
		---.Document\shell\printto\command
			@="C:\---\---.exe /pt \"%1\" \"%2\" \"%3\" \"%4\""
		//	MDI
		---.Document\shell\open\command
			@="C:\---\---.exe /dde"
		---.Document\shell\open\ddeexec
			@="[open(\"%1\")]"
		---.Document\shell\print\command
			@="C:\---\---.exe /dde"
		---.Document\shell\print\ddeexec
			@="[print(\"%1\")]"
		---.Document\shell\printto\command
			@="C:\---\---.exe /dde"
		---.Document\shell\printto\ddeexec
			@="[printto(\"%1\",\"%2\",\"%3\",\"%4\")]"
	シェル拡張		シェル拡張機能ハンドラーの作成
		.ext\ShellEx\{00021500-0000-0000-C000-000000000046}		//	ヒントハンドラ  	IQueryInfo
			@="{E5DF01A5-DA8F-4398-A99D-94A04B04CA2F}"			//	iShelExt.dll
		.ext\ShellEx\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}		//	イメージハンドラ	IExtractImage
			@="{D28D515B-3377-418E-B866-6DADF18469B1}"			//	MShellE.dll
	Win10 などでドキュメントをダブルクリックしての関連付け
		\HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ext\OpenWithList
			"a"="firefox.exe"
			"b"="---.exe"
			"MRUList"="ab"
		\HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ext\OpenWithProgids
			"ext_auto_file"=hex(0):
		\HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.ext\UserChoice
			"Hash"="L+hf9oR2C4c="
			"ProgId"="Applications\\firefox.exe"
2025/01/23
void CDocManager::RegisterShellFileTypes(BOOL bCompat)
{
	//	exe 名の取得
	AfxGetModuleShortFileName(AfxGetInstanceHandle(), strPathName);
	POSITION pos = m_templateList.GetHeadPosition();
	for (int nTemplateIndex = 1; pos != NULL; nTemplateIndex++)	{
		CDocTemplate* pTemplate = (CDocTemplate*)m_templateList.GetNext(pos);
		CString strOpen       CommandLine   = strPathName;
		CString strPrint      CommandLine   = strPathName;
		CString strPrintTo    CommandLine   = strPathName;
		CString strDefaultIconCommandLine   = strPathName;
		if (bCompat)	{
			CString strIconIndex;
			HICON hIcon = ::ExtractIcon(AfxGetInstanceHandle(), strPathName, nTemplateIndex);
			if (hIcon != NULL)	{
				strIconIndex.Format(_afxIconIndexFmt, nTemplateIndex);
				DestroyIcon(hIcon);
				}
			else	{
				strIconIndex.Format(_afxIconIndexFmt, DEFAULT_ICON_INDEX);
				}
			strDefaultIconCommandLine += strIconIndex;
			}
		CString strFilterExt, strFileTypeId, strFileTypeName;
		if (pTemplate->GetDocString(strFileTypeId,
		   CDocTemplate::regFileTypeId) && !strFileTypeId.IsEmpty())
		{
			// enough info to register it
			if (!pTemplate->GetDocString(strFileTypeName,
			   CDocTemplate::regFileTypeName))
				strFileTypeName = strFileTypeId;    // use id name
			ASSERT(strFileTypeId.Find(' ') == -1);  // no spaces allowed
			// first register the type ID of our server
			if (!_AfxSetRegKey(strFileTypeId, strFileTypeName))
				continue;       // just skip it									****	HKCR のためここで抜ける
			if (bCompat)	{													//		アイコンの登録
				// path\DefaultIcon = path,1
				strTemp.Format(_afxDefaultIconFmt, (LPCTSTR)strFileTypeId);
				if (!_AfxSetRegKey(strTemp, strDefaultIconCommandLine))
					continue;       // just skip it
				}
			//	...
			}
		}
	}
App.reg
REGEDIT
; This .REG file may be used by your SETUP program.
;   If a SETUP program is not available, the entries below will be
;   registered in your InitInstance automatically with a call to
;   CWinApp::RegisterShellFileTypes and COleObjectFactory::UpdateRegistryAll.
HKEY_CLASSES_ROOT\.mbp = MBPV.Document
HKEY_CLASSES_ROOT\MBPV.Document\shell\open\command = MBPV.EXE %1
HKEY_CLASSES_ROOT\MBPV.Document\shell\open\ddeexec = [open("%1")]
HKEY_CLASSES_ROOT\MBPV.Document\shell\open\ddeexec\application = MBPV
    ; note: the application is optional
    ;  (it defaults to the app name in "command")
HKEY_CLASSES_ROOT\MBPV.Document = MBPV Document