コード例 #1
0
ファイル: main.cpp プロジェクト: MANICX100/vbjin
void RecordMovie(HWND hWnd){
	char szChoice[MAX_PATH]={0};
	soundDriver->pause();
	OPENFILENAME ofn;

	// browse button
	ZeroMemory(&ofn, sizeof(ofn));
	ofn.lStructSize = sizeof(ofn);
	ofn.hwndOwner = hWnd;
	ofn.lpstrFilter = "Movie File (*.mc2)\0*.mc2\0All files(*.*)\0*.*\0\0";
	ofn.lpstrFile = (LPSTR)szChoice;
	ofn.lpstrTitle = "Record a new movie";
	ofn.lpstrDefExt = "mc2";
	ofn.nMaxFile = MAX_PATH;
	ofn.Flags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;

	if(GetSaveFileName(&ofn))
		FCEUI_SaveMovie(szChoice, a, 1);

	//If user did not specify an extension, add .mc2 for them
	// fname = szChoice;
	// x = fname.find_last_of(".");
	// if (x < 0)
	// fname.append(".mc2");

	// SetDlgItemText(hwndDlg, IDC_EDIT_FILENAME, fname.c_str());
	//if(GetSaveFileName(&ofn))
	// UpdateRecordDialogPath(hwndDlg,szChoice);

	pcejin.tempUnPause();

}
コード例 #2
0
ファイル: replay.cpp プロジェクト: snowasnow/DeSmuME
//Record movie dialog
static BOOL CALLBACK RecordDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	static struct CreateMovieParameters* p = NULL;
	std::wstring author = L"";
	switch(uMsg)
	{
	case WM_INITDIALOG:

		return false;
		case WM_COMMAND:
			switch(LOWORD(wParam))
			{
			case IDOK: {
				author = GetDlgItemTextW<500>(hwndDlg,IDC_EDIT_AUTHOR);
				std::string fname = GetDlgItemText<MAX_PATH>(hwndDlg,IDC_EDIT_FILENAME);
				FCEUI_SaveMovie(fname.c_str(), author);
				EndDialog(hwndDlg, 0);
				return true;
				}

			case IDCANCEL:
				EndDialog(hwndDlg, 0);
				return true;
	
			case IDC_BUTTON_BROWSEFILE:
			{
				OPENFILENAME ofn;
				char szChoice[MAX_PATH]={0};
				char recordfilename[MAX_PATH];

				// browse button
				ZeroMemory(&ofn, sizeof(ofn));
				ofn.lStructSize = sizeof(ofn);
				ofn.hwndOwner = MainWindow->getHWnd();
				ofn.lpstrFilter = "Desmume Movie File (*.dsm)\0*.dsm\0All files(*.*)\0*.*\0\0";
				ofn.lpstrFile = szChoice;
				ofn.lpstrTitle = "Record a new movie";
				ofn.lpstrDefExt = "dsm";
				ofn.nMaxFile = MAX_PATH;
				ofn.Flags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
				GetSaveFileName(&ofn);
				strcpy(recordfilename, szChoice);
				SetDlgItemText(hwndDlg, IDC_EDIT_FILENAME, recordfilename);
				//if(GetSaveFileName(&ofn))
				//	UpdateRecordDialogPath(hwndDlg,szChoice);

				return true;
			}

		}

	}
	
	return false;
}
コード例 #3
0
ファイル: commandline.cpp プロジェクト: libretro/desmume
void CommandLine::process_movieCommands()
{
	if(play_movie_file != "")
	{
		FCEUI_LoadMovie(play_movie_file.c_str(),true,false,-1);
	}
	else if(record_movie_file != "")
	{
		FCEUI_SaveMovie(record_movie_file.c_str(), L"", START_BLANK, NULL, FCEUI_MovieGetRTCDefault());
	}
}
コード例 #4
0
ファイル: commandline.cpp プロジェクト: H8sn0w/desmumewii
void CommandLine::process_movieCommands()
{
	if(play_movie_file != "")
	{
		FCEUI_LoadMovie(play_movie_file.c_str(),true,false,-1);
	}
	else if(record_movie_file != "")
	{
		FCEUI_SaveMovie(record_movie_file.c_str(), L"", 0, NULL);
	}
}
コード例 #5
0
ファイル: replay.cpp プロジェクト: RetroAchievements/RASuite
//Show the record movie dialog and record a movie.
void FCEUD_MovieRecordTo()
{
	if (RA_HardcoreModeIsActive())
	{
		MessageBox(nullptr, ("Hardcore Mode is active. Movie Recording/Playback is disabled."), ("Warning"), MB_OK);
		return;
	}

	if (!GameInfo) return;
	static struct CreateMovieParameters p;
	p.szFilename = strdup(FCEU_MakeFName(FCEUMKF_MOVIE,0,0).c_str());
	if(p.recordFrom >= 2) p.recordFrom=1;

	if(DialogBoxParam(fceu_hInstance, "IDD_RECORDINP", hAppWnd, RecordDialogProc, (LPARAM)&p))
	{
		if(p.recordFrom >= 2)
		{
			// attempt to load the savestate
			// FIXME:  pop open a messagebox if this fails
			FCEUI_LoadState(p.szSavestateFilename.c_str());
			{
				extern int loadStateFailed;

				if(loadStateFailed)
				{
					char str [1024];
					sprintf(str, "Failed to load save state \"%s\".\nRecording from current state instead...", p.szSavestateFilename.c_str());
					FCEUD_PrintError(str);
				}
			}
		}

		EMOVIE_FLAG flags = MOVIE_FLAG_NONE;
		if(p.recordFrom == 0) flags = MOVIE_FLAG_FROM_POWERON;
		FCEUI_SaveMovie(p.szFilename.c_str(), flags, p.authorName);
	}
}
コード例 #6
0
ファイル: input.c プロジェクト: BruceJawn/FlashNES
static void KeyboardCommands(void)
{
  int is_shift, is_alt;

  keys=GetKeyboard(); 

  if(InputType[2]==SIFC_FKB)	// Family Keyboard (FKB)
  {
   if(keyonly(SCROLLLOCK)) 
   {
    cidisabled^=1;
    FCEUI_DispMessage("Family Keyboard %sabled.",cidisabled?"en":"dis");
   }
   #ifdef SDL
   	SDL_WM_GrabInput( cidisabled? SDL_GRAB_ON: SDL_GRAB_OFF );
   #endif
   if(cidisabled) return;
  }

  is_shift = KEY(LEFTSHIFT) | KEY(RIGHTSHIFT);
  is_alt = KEY(LEFTALT) | KEY(RIGHTALT);

   #ifdef SDL
	if(keyonly(F4))
	{
		if(is_shift)
			FCEUI_SetRenderDisable(-1, 2);
		else
			FCEUI_SetRenderDisable(2, -1);
	}
	#endif
	
	#if defined(SDL) && !defined(FLASH)
		if(keyonly(ENTER) && is_alt) ToggleFS();
	#endif


// Disable most keyboard shortcuts in Flash
#ifndef FLASH

	NoWaiting &=~ 1;
	
	if(KEY(GRAVE))
	{
		NoWaiting|=1;
	}
	
	if(gametype==GIT_FDS)
	{
		if(keyonly(F6)) FCEUI_FDSSelect();
		if(keyonly(F8)) FCEUI_FDSInsert(0);
	}
	
	if(keyonly(F9))
	{
		FCEUI_SaveSnapshot();
	}

	if(gametype!=GIT_NSF)
	{
		#ifndef EXTGUI
		if(keyonly(F2))
		{
			DoCheatSeq();
		}
		#endif
		
		if(keyonly(F5)) 
		{
			if(is_shift)
				FCEUI_SaveMovie(NULL);
			else
				FCEUI_SaveState(NULL);
		}
		
		if(keyonly(F7)) 
		{
			if(is_shift)
				FCEUI_LoadMovie(NULL);
			else
				FCEUI_LoadState(NULL);
		}
	}

  if(keyonly(F1)) FCEUI_ToggleTileView();

  if(keyonly(F10)) FCEUI_ResetNES();
  if(keyonly(F11)) FCEUI_PowerNES();

  #ifdef EXTGUI
  if(keyonly(F3)) GUI_Hide(-1);
  if(KEY(F12)) GUI_RequestExit();
  if(KEY(ESCAPE)) CloseGame();
  #else
  if(KEY(F12) || KEY(ESCAPE)) CloseGame();
  #endif

  if(gametype==GIT_VSUNI)
  {
	if(keyonly(F8)) FCEUI_VSUniCoin();
	if(keyonly(F6))
        {
	 DIPS^=1;
	 FCEUI_VSUniToggleDIPView();
	}
	if(!(DIPS&1)) goto DIPSless;
	if(keyonly(1)) FCEUI_VSUniToggleDIP(0);
	if(keyonly(2)) FCEUI_VSUniToggleDIP(1);
	if(keyonly(3)) FCEUI_VSUniToggleDIP(2);
	if(keyonly(4)) FCEUI_VSUniToggleDIP(3);
	if(keyonly(5)) FCEUI_VSUniToggleDIP(4);
	if(keyonly(6)) FCEUI_VSUniToggleDIP(5);
	if(keyonly(7)) FCEUI_VSUniToggleDIP(6);
	if(keyonly(8)) FCEUI_VSUniToggleDIP(7);
  }
  else
  {
   static uint8 bbuf[32];
   static int bbuft;
   static int barcoder = 0;

   if(keyonly(H)) FCEUI_NTSCSELHUE();
   if(keyonly(T)) FCEUI_NTSCSELTINT();
   if(KEY(KP_MINUS) || KEY(MINUS)) FCEUI_NTSCDEC();
   if(KEY(KP_PLUS) || KEY(EQUAL)) FCEUI_NTSCINC();

   if((InputType[2] == SIFC_BWORLD) || (cspec == SIS_DATACH))
   {
    if(keyonly(F8)) 
    {
     barcoder ^= 1;
     if(!barcoder)
     {
      if(InputType[2] == SIFC_BWORLD)
      {
       strcpy(&BWorldData[1],bbuf);
       BWorldData[0]=1;
      }
      else
       FCEUI_DatachSet(bbuf);
      FCEUI_DispMessage("Barcode Entered");
     } 
     else { bbuft = 0; FCEUI_DispMessage("Enter Barcode");}
    }
   } else barcoder = 0;

	#define SSM(x)		\
	{ if(barcoder) { if(bbuft < 13) {bbuf[bbuft++] = '0' + x; bbuf[bbuft] = 0;} FCEUI_DispMessage("Barcode: %s",bbuf);}	\
	else { 			\
	 if(is_shift) FCEUI_SelectMovie(x); 	\
	 else FCEUI_SelectState(x); 	\
	} }

   DIPSless:
   if(keyonly(0)) SSM(0);
   if(keyonly(1)) SSM(1);
   if(keyonly(2)) SSM(2);
   if(keyonly(3)) SSM(3);
   if(keyonly(4)) SSM(4);
   if(keyonly(5)) SSM(5);
   if(keyonly(6)) SSM(6);
   if(keyonly(7)) SSM(7);
   if(keyonly(8)) SSM(8);
   if(keyonly(9)) SSM(9);
   #undef SSM
 }
#endif
}
コード例 #7
0
ファイル: input.c プロジェクト: GinBunBun/Fceumm-PS2
static void KeyboardCommands(void) {
    int is_shift, is_alt;

    keys = GetKeyboard();

    if ((InputType[2] == SIFC_FKB) || (InputType[2] == SIFC_SUBORKB) || (InputType[2] == SIFC_PEC586KB)) {
        if (cidisabled) return;
    }

    is_shift = KEY(LEFTSHIFT) | KEY(RIGHTSHIFT);
    is_alt = KEY(LEFTALT) | KEY(RIGHTALT);

    if (keyonly(F4)) {
        if (is_shift) FCEUI_SetRenderDisable(-1, 2);
        else FCEUI_SetRenderDisable(2, -1);
    }

    {
        static int nocount = 0;

        NoWaiting &= ~1;
        if (KEY(GRAVE))	//&& nocount)
            NoWaiting |= 1;
        nocount = (nocount + 1) & 3;
    }

    if (gametype == GIT_FDS) {
        if (keyonly(F6)) FCEUI_FDSSelect();
        if (keyonly(F8)) FCEUI_FDSInsert(0);
    }

    if (keyonly(F9)) FCEUI_SaveSnapshot();
    if (gametype != GIT_NSF) {
        if (keyonly(F5)) {
            if (is_shift)
                FCEUI_SaveMovie(NULL);
            else
                FCEUI_SaveState(NULL);
        }
        if (keyonly(F7)) {
            if (is_shift)
                FCEUI_LoadMovie(NULL);
            else
                FCEUI_LoadState(NULL);
        }
    }

//  if(keyonly(F1)) FCEUI_ToggleTileView();

    if (gametype == GIT_VSUNI) {
        if (keyonly(F8)) FCEUI_VSUniCoin();
        if (keyonly(F6)) {
            DIPS ^= 1;
            FCEUI_VSUniToggleDIPView();
        }
        if (!(DIPS & 1)) goto DIPSless;
        if (keyonly(1)) FCEUI_VSUniToggleDIP(0);
        if (keyonly(2)) FCEUI_VSUniToggleDIP(1);
        if (keyonly(3)) FCEUI_VSUniToggleDIP(2);
        if (keyonly(4)) FCEUI_VSUniToggleDIP(3);
        if (keyonly(5)) FCEUI_VSUniToggleDIP(4);
        if (keyonly(6)) FCEUI_VSUniToggleDIP(5);
        if (keyonly(7)) FCEUI_VSUniToggleDIP(6);
        if (keyonly(8)) FCEUI_VSUniToggleDIP(7);
    } else {
        static uint8 bbuf[32];
        static int bbuft;
        static int barcoder = 0;

        if (keyonly(H)) FCEUI_NTSCSELHUE();
        if (keyonly(T)) FCEUI_NTSCSELTINT();
        if (KEY(KP_MINUS) || KEY(MINUS)) FCEUI_NTSCDEC();
        if (KEY(KP_PLUS) || KEY(EQUAL)) FCEUI_NTSCINC();

        if ((InputType[2] == SIFC_BWORLD) || (cspec == SIS_DATACH)) {
            if (keyonly(F8)) {
                barcoder ^= 1;
                if (!barcoder) {
                    if (InputType[2] == SIFC_BWORLD) {
                        strcpy(&BWorldData[1], bbuf);
                        BWorldData[0] = 1;
                    } else
                        FCEUI_DatachSet(bbuf);
                    FCEUI_DispMessage("Barcode Entered");
                } else {
                    bbuft = 0;
                    FCEUI_DispMessage("Enter Barcode");
                }
            }
        } else barcoder = 0;

#define SSM(x)				  \
	{ if (barcoder) { if (bbuft < 13) { bbuf[bbuft++] = '0' + x; bbuf[bbuft] = 0; } FCEUI_DispMessage("Barcode: %s", bbuf); }		 \
	  else {						 \
		  if (is_shift) FCEUI_SelectMovie(x);		  \
		  else FCEUI_SelectState(x);		 \
	  }	\
	}

DIPSless:
        if (keyonly(0)) SSM(0);
        if (keyonly(1)) SSM(1);
        if (keyonly(2)) SSM(2);
        if (keyonly(3)) SSM(3);
        if (keyonly(4)) SSM(4);
        if (keyonly(5)) SSM(5);
        if (keyonly(6)) SSM(6);
        if (keyonly(7)) SSM(7);
        if (keyonly(8)) SSM(8);
        if (keyonly(9)) SSM(9);
#undef SSM
    }
}
コード例 #8
0
ファイル: replay.cpp プロジェクト: snowasnow/DeSmuME
//Record movie dialog
static INT_PTR CALLBACK RecordDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	static struct CreateMovieParameters* p = NULL;
	std::wstring author = L"";
	std::string fname;
	switch(uMsg)
	{
		case WM_INITDIALOG:
			CheckDlgButton(hwndDlg, IDC_START_FROM_SRAM, ((flag == 1) ? BST_CHECKED : BST_UNCHECKED));
			SetFocus(GetDlgItem(hwndDlg, IDC_EDIT_FILENAME));
			return false;

		case WM_COMMAND:
			switch(LOWORD(wParam))
			{
			case IDOK: {
				author = GetDlgItemTextW<500>(hwndDlg,IDC_EDIT_AUTHOR);
				fname = GetDlgItemText<MAX_PATH>(hwndDlg,IDC_EDIT_FILENAME);
				std::string sramfname = GetDlgItemText<MAX_PATH>(hwndDlg,IDC_EDIT_SRAMFILENAME);
				if (fname.length())
				{
					FCEUI_SaveMovie(fname.c_str(), author, flag, sramfname);
					EndDialog(hwndDlg, 0);
				}
				return true;
			}

			case IDCANCEL:
				EndDialog(hwndDlg, 0);
				return true;
	
			case IDC_BUTTON_BROWSEFILE:
			{
				OPENFILENAME ofn;
				char szChoice[MAX_PATH]={0};
				GetDlgItemText(hwndDlg,IDC_EDIT_FILENAME,szChoice,MAX_PATH);

				// browse button
				ZeroMemory(&ofn, sizeof(ofn));
				ofn.lStructSize = sizeof(ofn);
				ofn.hwndOwner = hwndDlg;
				ofn.lpstrFilter = "Desmume Movie File (*.dsm)\0*.dsm\0All files(*.*)\0*.*\0\0";
				ofn.lpstrFile = szChoice;
				ofn.lpstrTitle = "Record a new movie";
				ofn.lpstrDefExt = "dsm";
				ofn.nMaxFile = MAX_PATH;
				ofn.Flags = OFN_OVERWRITEPROMPT | OFN_NOREADONLYRETURN | OFN_PATHMUSTEXIST;
				if(GetSaveFileName(&ofn))
				{
					fname = szChoice;
/* // windows does this automatically, since lpstrDefExt is set
					//If user did not specify an extension, add .dsm for them
					x = fname.find_last_of(".");
					if (x < 0)
						fname.append(".dsm");
*/
					SetDlgItemText(hwndDlg, IDC_EDIT_FILENAME, fname.c_str());
				}
				//if(GetSaveFileName(&ofn))
				//	UpdateRecordDialogPath(hwndDlg,szChoice);

				return true;
			}
			case IDC_BUTTON_BROWSESRAM:
			{
				OPENFILENAME ofn;
				char szChoice[MAX_PATH]={0};

				// browse button
				ZeroMemory(&ofn, sizeof(ofn));
				ofn.lStructSize = sizeof(ofn);
				ofn.hwndOwner = hwndDlg;
				ofn.lpstrFilter = "Desmume SRAM File (*.dsv)\0*.dsv\0All files(*.*)\0*.*\0\0";
				ofn.lpstrFile = szChoice;
				ofn.lpstrTitle = "Choose SRAM";
				ofn.lpstrDefExt = "dsv";
				ofn.nMaxFile = MAX_PATH;
				ofn.Flags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
				if(GetOpenFileName(&ofn))
				{
					fname = szChoice;
/* // windows does this automatically, since lpstrDefExt is set
				//If user did not specify an extension, add .dsv for them
				x = fname.find_last_of(".");
				if (x < 0)
					fname.append(".dsv");
*/
					SetDlgItemText(hwndDlg, IDC_EDIT_SRAMFILENAME, fname.c_str());
				}
				//if(GetSaveFileName(&ofn))
				//	UpdateRecordDialogPath(hwndDlg,szChoice);

				return true;
			}

			case IDC_EDIT_FILENAME:
				switch(HIWORD(wParam))
				{
					case EN_CHANGE:
					{
						FixRelativeMovieFilename(hwndDlg, IDC_EDIT_FILENAME);

						// disable the OK button if we can't write to the file
						char filename [MAX_PATH];
						GetDlgItemText(hwndDlg,IDC_EDIT_FILENAME,filename,MAX_PATH);
						EnableWindow(GetDlgItem(hwndDlg, IDOK), IsFileWritable(filename));
					}
					break;
				}
				break;
		}
	}

	HWND cur = GetDlgItem(hwndDlg, IDC_EDIT_SRAMFILENAME);
	
	IsDlgButtonChecked(hwndDlg, IDC_START_FROM_SRAM) ? flag=1 : flag=0;
	IsDlgButtonChecked(hwndDlg, IDC_START_FROM_SRAM) ? EnableWindow(cur, TRUE) : EnableWindow(cur, FALSE);

	cur = GetDlgItem(hwndDlg, IDC_BUTTON_BROWSESRAM);
	IsDlgButtonChecked(hwndDlg, IDC_START_FROM_SRAM) ? EnableWindow(cur, TRUE) : EnableWindow(cur, FALSE);

	return false;
}
コード例 #9
0
ファイル: replay.cpp プロジェクト: mboyd/Desmume-OSX
//Record movie dialog
static INT_PTR CALLBACK RecordDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	static struct CreateMovieParameters* p = NULL;
	std::wstring author = L"";
	std::string fname;
	SYSTEMTIME systime;
	switch(uMsg)
	{
		case WM_INITDIALOG: {
			CheckDlgButton(hwndDlg, IDC_START_FROM_SRAM, ((flag == 1) ? BST_CHECKED : BST_UNCHECKED));
			SetFocus(GetDlgItem(hwndDlg, IDC_EDIT_FILENAME));

			DateTime t = FCEUI_MovieGetRTCDefault();
			ZeroMemory(&systime, sizeof(SYSTEMTIME));
			systime.wYear = t.get_Year();
			systime.wMonth = t.get_Month();
			systime.wDay = t.get_Day();
			systime.wDayOfWeek = t.get_DayOfWeek();
			systime.wHour = t.get_Hour();
			systime.wMinute = t.get_Minute();
			systime.wSecond = t.get_Second();
			systime.wMilliseconds = t.get_Millisecond();
			DateTime_SetSystemtime(GetDlgItem(hwndDlg, IDC_DTP_DATE), GDT_VALID, &systime);
			DateTime_SetSystemtime(GetDlgItem(hwndDlg, IDC_DTP_TIME), GDT_VALID, &systime);

			union {
				struct { SYSTEMTIME rtcMin, rtcMax; };
				SYSTEMTIME rtcMinMax[2];
			};
			ZeroMemory(&rtcMin, sizeof(SYSTEMTIME));
			ZeroMemory(&rtcMax, sizeof(SYSTEMTIME));
			rtcMin.wYear = 2000;
			rtcMin.wMonth = 1;
			rtcMin.wDay = 1;
			rtcMin.wDayOfWeek = 6;
			rtcMax.wYear = 2099;
			rtcMax.wMonth = 12;
			rtcMax.wDay = 31;
			rtcMax.wDayOfWeek = 4;
			DateTime_SetRange(GetDlgItem(hwndDlg, IDC_DTP_DATE), GDTR_MIN, &rtcMinMax);
			DateTime_SetRange(GetDlgItem(hwndDlg, IDC_DTP_DATE), GDTR_MAX, &rtcMinMax);
			return false;
		}

		case WM_COMMAND:
			switch(LOWORD(wParam))
			{
			case IDOK: {
				author = GetDlgItemTextW<500>(hwndDlg,IDC_EDIT_AUTHOR);
				fname = GetDlgItemText<MAX_PATH>(hwndDlg,IDC_EDIT_FILENAME);
				std::string sramfname = GetDlgItemText<MAX_PATH>(hwndDlg,IDC_EDIT_SRAMFILENAME);
				if (fname.length())
				{
					struct tm t;

					DateTime_GetSystemtime(GetDlgItem(hwndDlg, IDC_DTP_DATE), &systime);
					t.tm_year = systime.wYear;
					t.tm_mon  = systime.wMonth;
					t.tm_mday = systime.wDay;
					t.tm_wday = systime.wDayOfWeek;
					DateTime_GetSystemtime(GetDlgItem(hwndDlg, IDC_DTP_TIME), &systime);
					t.tm_hour = systime.wHour;
					t.tm_min  = systime.wMinute;
					t.tm_sec  = systime.wSecond;
					DateTime rtcstart(t.tm_year,t.tm_mon,t.tm_mday,t.tm_hour,t.tm_min,t.tm_sec);

					FCEUI_SaveMovie(fname.c_str(), author, flag, sramfname, rtcstart);
					EndDialog(hwndDlg, 0);
				}
				return true;
			}

			case IDCANCEL:
				EndDialog(hwndDlg, 0);
				return true;
	
			case IDC_BUTTON_BROWSEFILE:
			{
				OPENFILENAME ofn;
				char szChoice[MAX_PATH]={0};
				GetDlgItemText(hwndDlg,IDC_EDIT_FILENAME,szChoice,MAX_PATH);

				// browse button
				ZeroMemory(&ofn, sizeof(ofn));
				ofn.lStructSize = sizeof(ofn);
				ofn.hwndOwner = hwndDlg;
				ofn.lpstrFilter = "Desmume Movie File (*.dsm)\0*.dsm\0All files(*.*)\0*.*\0\0";
				ofn.lpstrFile = szChoice;
				ofn.lpstrTitle = "Record a new movie";
				ofn.lpstrDefExt = "dsm";
				ofn.nMaxFile = MAX_PATH;
				ofn.Flags = OFN_OVERWRITEPROMPT | OFN_NOREADONLYRETURN | OFN_PATHMUSTEXIST;
				if(GetSaveFileName(&ofn))
				{
					fname = szChoice;
/* // windows does this automatically, since lpstrDefExt is set
					//If user did not specify an extension, add .dsm for them
					x = fname.find_last_of(".");
					if (x < 0)
						fname.append(".dsm");
*/
					SetDlgItemText(hwndDlg, IDC_EDIT_FILENAME, fname.c_str());
				}
				//if(GetSaveFileName(&ofn))
				//	UpdateRecordDialogPath(hwndDlg,szChoice);

				return true;
			}
			case IDC_BUTTON_BROWSESRAM:
			{
				OPENFILENAME ofn;
				char szChoice[MAX_PATH]={0};

				// browse button
				ZeroMemory(&ofn, sizeof(ofn));
				ofn.lStructSize = sizeof(ofn);
				ofn.hwndOwner = hwndDlg;
				ofn.lpstrFilter = "Desmume SRAM File (*.dsv)\0*.dsv\0All files(*.*)\0*.*\0\0";
				ofn.lpstrFile = szChoice;
				ofn.lpstrTitle = "Choose SRAM";
				ofn.lpstrDefExt = "dsv";
				ofn.nMaxFile = MAX_PATH;
				ofn.Flags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
				if(GetOpenFileName(&ofn))
				{
					fname = szChoice;
/* // windows does this automatically, since lpstrDefExt is set
				//If user did not specify an extension, add .dsv for them
				x = fname.find_last_of(".");
				if (x < 0)
					fname.append(".dsv");
*/
					SetDlgItemText(hwndDlg, IDC_EDIT_SRAMFILENAME, fname.c_str());
				}
				//if(GetSaveFileName(&ofn))
				//	UpdateRecordDialogPath(hwndDlg,szChoice);

				return true;
			}

			case IDC_EDIT_FILENAME:
				switch(HIWORD(wParam))
				{
					case EN_CHANGE:
					{
						FixRelativeMovieFilename(hwndDlg, IDC_EDIT_FILENAME);

						// disable the OK button if we can't write to the file
						char filename [MAX_PATH];
						GetDlgItemText(hwndDlg,IDC_EDIT_FILENAME,filename,MAX_PATH);
						EnableWindow(GetDlgItem(hwndDlg, IDOK), IsFileWritable(filename));
					}
					break;
				}
				break;
		}
	}

	HWND cur = GetDlgItem(hwndDlg, IDC_EDIT_SRAMFILENAME);
	
	IsDlgButtonChecked(hwndDlg, IDC_START_FROM_SRAM) ? flag=1 : flag=0;
	IsDlgButtonChecked(hwndDlg, IDC_START_FROM_SRAM) ? EnableWindow(cur, TRUE) : EnableWindow(cur, FALSE);

	cur = GetDlgItem(hwndDlg, IDC_BUTTON_BROWSESRAM);
	IsDlgButtonChecked(hwndDlg, IDC_START_FROM_SRAM) ? EnableWindow(cur, TRUE) : EnableWindow(cur, FALSE);

	return false;
}