MCPcopy Create free account
hub / github.com/TASEmulators/fceux / RecordDialogProc

Function RecordDialogProc

src/drivers/win/replay.cpp:844–1019  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

842}
843
844static INT_PTR CALLBACK RecordDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
845{
846 static struct CreateMovieParameters* p = NULL;
847
848 switch(uMsg)
849 {
850 case WM_INITDIALOG:
851 p = (struct CreateMovieParameters*)lParam;
852 UpdateRecordDialogPath(hwndDlg, p->szFilename);
853 p->szFilename = "";
854
855 if (strlen(taseditorConfig.lastAuthorName))
856 {
857 // convert UTF8 char* string to Unicode wstring
858 wchar_t savedAuthorName[AUTHOR_NAME_MAX_LEN] = {0};
859 MultiByteToWideChar(CP_UTF8, 0, taseditorConfig.lastAuthorName, -1, savedAuthorName, AUTHOR_NAME_MAX_LEN);
860 p->authorName = savedAuthorName;
861 } else
862 {
863 p->authorName = L"";
864 }
865 SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_AUTHOR), CCM_SETUNICODEFORMAT, TRUE, 0);
866 SetDlgItemTextW(hwndDlg, IDC_EDIT_AUTHOR, (LPCWSTR)(p->authorName.c_str()));
867
868 // Populate the "record from..." dialog
869 {
870 char* findGlob=strdup(FCEU_MakeFName(FCEUMKF_STATEGLOB, 0, 0).c_str());
871 WIN32_FIND_DATA wfd;
872 HANDLE hFind;
873 int i=0;
874
875 SendDlgItemMessage(hwndDlg, IDC_COMBO_RECORDFROM, CB_INSERTSTRING, i++, (LPARAM)"Start");
876 SendDlgItemMessage(hwndDlg, IDC_COMBO_RECORDFROM, CB_INSERTSTRING, i++, (LPARAM)"Now");
877 SendDlgItemMessage(hwndDlg, IDC_COMBO_RECORDFROM, CB_INSERTSTRING, i++, (LPARAM)"SaveRam");
878
879 memset(&wfd, 0, sizeof(wfd));
880 hFind = FindFirstFile(findGlob, &wfd);
881 if(hFind != INVALID_HANDLE_VALUE)
882 {
883 do
884 {
885 if ((wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ||
886 (wfd.dwFileAttributes & FILE_ATTRIBUTE_READONLY))
887 continue;
888
889 if (strlen(wfd.cFileName) < 4 ||
890 !strcmp(wfd.cFileName + (strlen(wfd.cFileName) - 4), ".fm2"))
891 continue;
892
893 SendDlgItemMessage(hwndDlg, IDC_COMBO_RECORDFROM, CB_INSERTSTRING, i++, (LPARAM)wfd.cFileName);
894 } while(FindNextFile(hFind, &wfd));
895 FindClose(hFind);
896 }
897 free(findGlob);
898
899 SendDlgItemMessage(hwndDlg, IDC_COMBO_RECORDFROM, CB_INSERTSTRING, i++, (LPARAM)"Browse...");
900 SendDlgItemMessage(hwndDlg, IDC_COMBO_RECORDFROM, CB_SETCURSEL, p->recordFrom, 0);
901 }

Callers

nothing calls this directly

Calls 8

UpdateRecordDialogPathFunction · 0.85
FCEU_MakeFNameFunction · 0.85
UpdateRecordDialogFunction · 0.85
DisableAllCheatsFunction · 0.85
UpdateCheatRelatedWindowFunction · 0.85
GetRecordPathFunction · 0.85
GetDlgItemTextWFunction · 0.85
GetSavePathFunction · 0.85

Tested by

no test coverage detected