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

Function CDLoggerCallB

src/drivers/win/cdlogger.cpp:62–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60char loadedcdfile[2048] = {0};
61
62INT_PTR CALLBACK CDLoggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
63{
64 switch(uMsg)
65 {
66 case WM_DROPFILES:
67 {
68 UINT len;
69 char *ftmp;
70
71 len=DragQueryFile((HDROP)wParam,0,0,0)+1;
72 if((ftmp=(char*)malloc(len)))
73 {
74 DragQueryFile((HDROP)wParam,0,ftmp,len);
75 string fileDropped = ftmp;
76 //adelikat: Drag and Drop only checks file extension, the internal functions are responsible for file error checking
77 //-------------------------------------------------------
78 //Check if .tbl
79 //-------------------------------------------------------
80 if (!(fileDropped.find(".cdl") == string::npos) && (fileDropped.find(".cdl") == fileDropped.length()-4))
81 {
82 if(!LoadCDLog(fileDropped.c_str()))
83 FCEUD_PrintError("Error Opening CDL File!");
84 }
85 else
86 {
87 std::string str = "Could not open " + fileDropped;
88 MessageBox(hwndDlg, str.c_str(), "File error", 0);
89 }
90 }
91 }
92
93 break;
94
95 case WM_MOVE:
96 {
97 if (!IsIconic(hwndDlg))
98 {
99 RECT wrect;
100 GetWindowRect(hwndDlg,&wrect);
101 CDLogger_wndx = wrect.left;
102 CDLogger_wndy = wrect.top;
103 WindowBoundsCheckNoResize(CDLogger_wndx,CDLogger_wndy,wrect.right);
104 }
105 break;
106 };
107 case WM_INITDIALOG:
108 if (CDLogger_wndx==-32000) CDLogger_wndx=0; //Just in case
109 if (CDLogger_wndy==-32000) CDLogger_wndy=0;
110 SetWindowPos(hwndDlg, 0, CDLogger_wndx, CDLogger_wndy, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_NOOWNERZORDER);
111 hCDLogger = hwndDlg;
112 InitCDLog();
113 ResetCDLog();
114 RenameCDLog("");
115 if (autoloadCDL)
116 {
117 char nameo[2048];
118 strcpy(nameo, GetRomPath().c_str());
119 strcat(nameo, mass_replace(GetRomName(), "|", ".").c_str());

Callers

nothing calls this directly

Calls 15

GetRomPathFunction · 0.85
mass_replaceFunction · 0.85
GetRomNameFunction · 0.85
UpdateCDLoggerFunction · 0.85
LoadCDLogFileFunction · 0.85
FCEUI_GetLoggingCDFunction · 0.85
SaveCDLogFileAsFunction · 0.85
SaveStrippedROMFunction · 0.85
LoadCDLogFunction · 0.70
FCEUD_PrintErrorFunction · 0.70
InitCDLogFunction · 0.70

Tested by

no test coverage detected