Win32 - implemented Drag & Drop for movie (.fm2) files

This commit is contained in:
adelikat 2008-11-16 02:58:02 +00:00
parent 7b3b667c08
commit e64ce0f489
2 changed files with 24 additions and 4 deletions

View File

@ -1,4 +1,5 @@
---version 2.0.4 yet to be released---
15-nov-2008 - adelikat - win32 - Implemented Drap & Drop for movie files
14-nov-2008 - adelikat - win32 Hex Editor - Dump Rom & Dump PPU to file Dialog - uses ROM to build default filename
14-nov-2008 - adelikat - Win32 Memwatch - Save as dialog - uses ROM name to build default memwatch filename if there is no last used memwatch filename
14-nov-2008 - adelikat - Win32 Text Hooker fixes - Init error checking reinstated, save .tht file no longer crashes, Dialog updates as ROM plays, Remembers window position, fix bug where canceling save as produces an error message, Save As produces default filename based on loaded ROM

View File

@ -63,6 +63,8 @@
#include <fstream>
using namespace std;
// Extern variables
extern FCEUGI *GameInfo;
@ -789,13 +791,30 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
UINT len;
char *ftmp;
len=DragQueryFile((HDROP)wParam,0,0,0)+1; //mbg merge 7/17/06 changed (HANDLE) to (HDROP)
if((ftmp=(char*)malloc(len))) //mbg merge 7/17/06 added cast
len=DragQueryFile((HDROP)wParam,0,0,0)+1;
if((ftmp=(char*)malloc(len)))
{
DragQueryFile((HDROP)wParam,0,ftmp,len);
string fileDropped = ftmp;
//-------------------------------------------------------
//Check if Movie file
//-------------------------------------------------------
if (!(fileDropped.find(".fm2") == string::npos)) //ROM is already loaded and .fm2 in filename
{
if (GameInfo && !(fileDropped.find(".fm2") == string::npos)) //.fm2 is at the end of the filename so that must be the extension
FCEUI_LoadMovie(ftmp, 1, false, false); //We are convinced it is a movie file, attempt to load it
}
//-------------------------------------------------------
//If not a movie, Load it as a ROM file
//-------------------------------------------------------
else
{
DragQueryFile((HDROP)wParam,0,ftmp,len); //mbg merge 7/17/06 changed (HANDLE) to (HDROP)
ALoad(ftmp);
free(ftmp);
}
}
}
break;