Skip to content

Commit

Permalink
Properly associate .dnm files to open in Dn-FamiTracker
Browse files Browse the repository at this point in the history
This only works with #define WIP removed.
  • Loading branch information
nyanpasu64 committed Feb 26, 2024
1 parent 47aa564 commit 5a2b97e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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
5 changes: 4 additions & 1 deletion Source/FamiTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ BOOL CFamiTrackerApp::InitInstance()

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

// See https://learn.microsoft.com/en-us/cpp/mfc/reference/cdoctemplate-class?view=msvc-170#getdocstring
// for the format of the IDR_MAINFRAME string.
CDocTemplate0CC* pDocTemplate = new CDocTemplate0CC( // // //
IDR_MAINFRAME,
RUNTIME_CLASS(CFamiTrackerDoc),
Expand All @@ -208,7 +211,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

0 comments on commit 5a2b97e

Please sign in to comment.