Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly associate .dnm files to open in Dn-FamiTracker #270

Merged
merged 1 commit into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dn-FamiTracker.rc
Original file line number Diff line number Diff line change
Expand Up @@ -2551,7 +2551,7 @@ IDR_HTML1 HTML "res/export_report.htm"

STRINGTABLE
BEGIN
IDR_MAINFRAME "Dn-FamiTracker\n\nDn-FamiTracker\nDn-FamiTracker modules (*.0cc;*.ftm)\n.0cc\n0CCFamiTracker.Document\n0CCFamiTracker.Document"
IDR_MAINFRAME "Dn-FamiTracker\n\nDn-FamiTracker\nDn-FamiTracker modules (*.dnm;*.0cc;*.ftm)\n.dnm\nDnFamiTracker.Document\nDn-FamiTracker Document"
IDS_FRAME_DROP_MOVE "Drop selection to move frames"
IDS_DPCM_IMPORT_QUALITY_FORMAT "Quality: %1"
IDS_CLIPBOARD_ERROR "Could not register clipboard format"
Expand Down
6 changes: 5 additions & 1 deletion Source/FamiTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ BOOL CFamiTrackerApp::InitInstance()

// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views

// The IDR_MAINFRAME string is used to create file associations with .dnm files.
// See https://learn.microsoft.com/en-us/cpp/mfc/reference/cdoctemplate-class?view=msvc-170#getdocstring
// for the format of this string.
CDocTemplate0CC* pDocTemplate = new CDocTemplate0CC( // // //
IDR_MAINFRAME,
RUNTIME_CLASS(CFamiTrackerDoc),
Expand All @@ -208,7 +212,7 @@ BOOL CFamiTrackerApp::InitInstance()
// Add shell options
RegisterShellFileTypes(); // // //
static const LPCTSTR FILE_ASSOC_NAME = _T(APP_NAME " Module");
AfxRegSetValue(HKEY_CLASSES_ROOT, "0CCFamiTracker.Document", REG_SZ, FILE_ASSOC_NAME, lstrlen(FILE_ASSOC_NAME) * sizeof(TCHAR));
AfxRegSetValue(HKEY_CLASSES_ROOT, "DnFamiTracker.Document", REG_SZ, FILE_ASSOC_NAME, lstrlen(FILE_ASSOC_NAME) * sizeof(TCHAR));
// Add an option to play files
CString strPathName, strTemp, strFileTypeId;
AfxGetModuleShortFileName(AfxGetInstanceHandle(), strPathName);
Expand Down