[Project64] Preserve current dir when calling GetOpenFileName
This commit is contained in:
parent
1d7bdd2c27
commit
52ab4949b4
|
@ -5,6 +5,10 @@
|
|||
#ifdef _WIN32
|
||||
#include <Shlobj.h>
|
||||
#include <dos.h>
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4996) // warning C4091: 'typedef ': ignored on left of 'tagGPFIDL_FLAGS' when no variable is declared
|
||||
#include <CommDlg.h>
|
||||
#pragma warning(pop)
|
||||
#else
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
|
@ -999,6 +1003,39 @@ bool CPath::Exists() const
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
bool CPath::SelectFile(void * hwndOwner, const char * InitialDir, const char * FileFilter, bool FileMustExist)
|
||||
{
|
||||
CPath CurrentDir(CURRENT_DIRECTORY);
|
||||
|
||||
OPENFILENAME openfilename;
|
||||
char FileName[MAX_PATH];
|
||||
memset(&FileName, 0, sizeof(FileName));
|
||||
memset(&openfilename, 0, sizeof(openfilename));
|
||||
|
||||
openfilename.lStructSize = sizeof(openfilename);
|
||||
openfilename.hwndOwner = (HWND)hwndOwner;
|
||||
openfilename.lpstrFilter = FileFilter;
|
||||
openfilename.lpstrFile = FileName;
|
||||
openfilename.lpstrInitialDir = InitialDir;
|
||||
openfilename.nMaxFile = MAX_PATH;
|
||||
openfilename.Flags = OFN_HIDEREADONLY | (FileMustExist ? OFN_FILEMUSTEXIST : 0);
|
||||
|
||||
bool res = GetOpenFileName(&openfilename);
|
||||
if (CPath(CURRENT_DIRECTORY) != CurrentDir)
|
||||
{
|
||||
CurrentDir.ChangeDirectory();
|
||||
}
|
||||
if (!res)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
m_strPath = FileName;
|
||||
cleanPathString(m_strPath);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// Post : Return TRUE on success
|
||||
// Task : Delete file
|
||||
|
|
|
@ -135,6 +135,9 @@ public:
|
|||
//File Information
|
||||
bool IsFile() const { return !IsDirectory(); }
|
||||
bool Exists() const;
|
||||
#ifdef _WIN32
|
||||
bool SelectFile(void * hwndOwner, const char * InitialDir, const char * FileFilter, bool FileMustExist);
|
||||
#endif
|
||||
|
||||
//Directory operations
|
||||
bool DirectoryCreate(bool bCreateIntermediates = true);
|
||||
|
|
|
@ -52,29 +52,16 @@ LRESULT CDumpMemory::OnClicked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/,
|
|||
break;
|
||||
case IDC_BTN_CHOOSE_FILE:
|
||||
{
|
||||
char FileName[_MAX_PATH], Directory[_MAX_PATH];
|
||||
OPENFILENAME openfilename;
|
||||
|
||||
memset(&FileName, 0, sizeof(FileName));
|
||||
memset(&openfilename, 0, sizeof(openfilename));
|
||||
strcpy(Directory, CPath(CPath::MODULE_DIRECTORY));
|
||||
openfilename.lStructSize = sizeof(openfilename);
|
||||
openfilename.hwndOwner = m_hWnd;
|
||||
openfilename.lpstrFilter = "Text file (*.txt)\0*.txt;\0All files (*.*)\0*.*\0";
|
||||
openfilename.lpstrFile = FileName;
|
||||
openfilename.lpstrInitialDir = Directory;
|
||||
openfilename.nMaxFile = MAX_PATH;
|
||||
openfilename.Flags = OFN_HIDEREADONLY;
|
||||
g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_DumpMemory);
|
||||
if (GetOpenFileName(&openfilename))
|
||||
|
||||
CPath FileName;
|
||||
if (FileName.SelectFile(m_hWnd, CPath(CPath::MODULE_DIRECTORY), "Text file (*.txt)\0*.txt;\0All files (*.*)\0*.*\0", false))
|
||||
{
|
||||
char drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
|
||||
_splitpath(FileName, drive, dir, fname, ext);
|
||||
if (strlen(ext) == 0)
|
||||
if (FileName.GetExtension().length() == 0)
|
||||
{
|
||||
strcat(FileName, ".txt");
|
||||
FileName.SetExtension("txt");
|
||||
SetDlgItemText(IDC_FILENAME, FileName);
|
||||
}
|
||||
SetDlgItemText(IDC_FILENAME, FileName);
|
||||
}
|
||||
g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_DumpMemory);
|
||||
}
|
||||
|
|
|
@ -984,58 +984,33 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
|
|||
stdstr IPLROM = g_Settings->LoadStringVal(File_DiskIPLPath);
|
||||
if ((IPLROM.length() <= 0) || (!g_BaseSystem->RunFileImageIPL(IPLROM.c_str())))
|
||||
{
|
||||
// Open DDROM
|
||||
OPENFILENAME openfilename;
|
||||
char FileName[_MAX_PATH], Directory[_MAX_PATH];
|
||||
|
||||
memset(&FileName, 0, sizeof(FileName));
|
||||
memset(&openfilename, 0, sizeof(openfilename));
|
||||
|
||||
strcpy(Directory, g_Settings->LoadStringVal(RomList_GameDir).c_str());
|
||||
|
||||
openfilename.lStructSize = sizeof(openfilename);
|
||||
openfilename.hwndOwner = (HWND)hWnd;
|
||||
openfilename.lpstrFilter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
|
||||
openfilename.lpstrFile = FileName;
|
||||
openfilename.lpstrInitialDir = Directory;
|
||||
openfilename.nMaxFile = MAX_PATH;
|
||||
openfilename.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
|
||||
|
||||
if (GetOpenFileName(&openfilename))
|
||||
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
|
||||
CPath FileName;
|
||||
if (FileName.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
|
||||
{
|
||||
g_BaseSystem->RunFileImageIPL(FileName);
|
||||
// Open Disk
|
||||
openfilename.lpstrFilter = "N64DD Disk Image (*.ndd)\0*.ndd\0All files (*.*)\0*.*\0";
|
||||
if (GetOpenFileName(&openfilename))
|
||||
const char * N64DDFilter = "N64DD Disk Image (*.ndd)\0*.ndd\0All files (*.*)\0*.*\0";
|
||||
if (FileName.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), N64DDFilter, true))
|
||||
{
|
||||
if (g_BaseSystem->RunDiskImage(FileName))
|
||||
{
|
||||
g_BaseSystem->RunFileImage(_this->CurrentedSelectedRom());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Open Disk
|
||||
OPENFILENAME openfilename;
|
||||
char FileName[_MAX_PATH], Directory[_MAX_PATH];
|
||||
|
||||
memset(&FileName, 0, sizeof(FileName));
|
||||
memset(&openfilename, 0, sizeof(openfilename));
|
||||
|
||||
strcpy(Directory, g_Settings->LoadStringVal(RomList_GameDir).c_str());
|
||||
|
||||
openfilename.lStructSize = sizeof(openfilename);
|
||||
openfilename.hwndOwner = (HWND)hWnd;
|
||||
openfilename.lpstrFilter = "N64DD Disk Image (*.ndd)\0*.ndd\0All files (*.*)\0*.*\0";
|
||||
openfilename.lpstrFile = FileName;
|
||||
openfilename.lpstrInitialDir = Directory;
|
||||
openfilename.nMaxFile = MAX_PATH;
|
||||
openfilename.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
|
||||
|
||||
if (GetOpenFileName(&openfilename))
|
||||
CPath FileName;
|
||||
const char * Filter = "N64DD Disk Image (*.ndd)\0*.ndd\0All files (*.*)\0*.*\0";
|
||||
if (FileName.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
|
||||
{
|
||||
if (g_BaseSystem->RunDiskImage(FileName))
|
||||
{
|
||||
g_BaseSystem->RunFileImage(_this->CurrentedSelectedRom());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1157,23 +1132,10 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO
|
|||
stdstr IPLROM = g_Settings->LoadStringVal(File_DiskIPLPath);
|
||||
if ((IPLROM.length() <= 0) || (!CN64System::RunFileImage(IPLROM.c_str())))
|
||||
{
|
||||
// Open DDROM
|
||||
OPENFILENAME openfilename;
|
||||
char FileName[_MAX_PATH], Directory[_MAX_PATH];
|
||||
memset(&FileName, 0, sizeof(FileName));
|
||||
memset(&openfilename, 0, sizeof(openfilename));
|
||||
|
||||
strcpy(Directory, g_Settings->LoadStringVal(RomList_GameDir).c_str());
|
||||
openfilename.lStructSize = sizeof(openfilename);
|
||||
openfilename.hwndOwner = (HWND)hWnd;
|
||||
openfilename.lpstrFilter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
|
||||
openfilename.lpstrFile = FileName;
|
||||
openfilename.lpstrInitialDir = Directory;
|
||||
openfilename.nMaxFile = MAX_PATH;
|
||||
openfilename.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
|
||||
|
||||
if (GetOpenFileName(&openfilename))
|
||||
{
|
||||
CPath FileName;
|
||||
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
|
||||
if (FileName.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
|
||||
{
|
||||
CN64System::RunFileImage(FileName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,29 +90,15 @@ int CMainMenu::ProcessAccelerator(HWND hWnd, void * lpMsg)
|
|||
return TranslateAccelerator((HWND)hWnd, (HACCEL)m_AccelTable, (LPMSG)lpMsg);
|
||||
}
|
||||
|
||||
stdstr CMainMenu::ChooseFileToOpen(HWND hParent)
|
||||
std::string CMainMenu::ChooseFileToOpen(HWND hParent)
|
||||
{
|
||||
OPENFILENAME openfilename;
|
||||
char FileName[_MAX_PATH], Directory[_MAX_PATH];
|
||||
|
||||
memset(&FileName, 0, sizeof(FileName));
|
||||
memset(&openfilename, 0, sizeof(openfilename));
|
||||
|
||||
strcpy(Directory, g_Settings->LoadStringVal(RomList_GameDir).c_str());
|
||||
|
||||
openfilename.lStructSize = sizeof(openfilename);
|
||||
openfilename.hwndOwner = (HWND)hParent;
|
||||
openfilename.lpstrFilter = "N64 ROMs (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin, *.ndd)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal;*.ndd\0All files (*.*)\0*.*\0";
|
||||
openfilename.lpstrFile = FileName;
|
||||
openfilename.lpstrInitialDir = Directory;
|
||||
openfilename.nMaxFile = MAX_PATH;
|
||||
openfilename.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
|
||||
|
||||
if (GetOpenFileName(&openfilename))
|
||||
CPath FileName;
|
||||
const char * Filter = "N64 ROMs (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin, *.ndd)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal;*.ndd\0All files (*.*)\0*.*\0";
|
||||
if (FileName.SelectFile(hParent, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
|
||||
{
|
||||
return stdstr(FileName);
|
||||
return FileName;
|
||||
}
|
||||
return stdstr("");
|
||||
return "";
|
||||
}
|
||||
|
||||
void CMainMenu::SetTraceModuleSetttings(SettingID Type)
|
||||
|
@ -123,7 +109,7 @@ void CMainMenu::SetTraceModuleSetttings(SettingID Type)
|
|||
|
||||
void CMainMenu::OnOpenRom(HWND hWnd)
|
||||
{
|
||||
stdstr File = ChooseFileToOpen(hWnd);
|
||||
std::string File = ChooseFileToOpen(hWnd);
|
||||
if (File.length() == 0)
|
||||
{
|
||||
return;
|
||||
|
@ -144,22 +130,9 @@ void CMainMenu::OnOpenRom(HWND hWnd)
|
|||
stdstr IPLROM = g_Settings->LoadStringVal(File_DiskIPLPath);
|
||||
if ((IPLROM.length() <= 0) || (!g_BaseSystem->RunFileImage(IPLROM.c_str())))
|
||||
{
|
||||
// Open DDROM
|
||||
OPENFILENAME openfilename;
|
||||
char FileName[_MAX_PATH], Directory[_MAX_PATH];
|
||||
memset(&FileName, 0, sizeof(FileName));
|
||||
memset(&openfilename, 0, sizeof(openfilename));
|
||||
|
||||
strcpy(Directory, g_Settings->LoadStringVal(RomList_GameDir).c_str());
|
||||
openfilename.lStructSize = sizeof(openfilename);
|
||||
openfilename.hwndOwner = (HWND)hWnd;
|
||||
openfilename.lpstrFilter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
|
||||
openfilename.lpstrFile = FileName;
|
||||
openfilename.lpstrInitialDir = Directory;
|
||||
openfilename.nMaxFile = MAX_PATH;
|
||||
openfilename.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
|
||||
|
||||
if (GetOpenFileName(&openfilename))
|
||||
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
|
||||
CPath FileName;
|
||||
if (FileName.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
|
||||
{
|
||||
g_BaseSystem->RunFileImage(FileName);
|
||||
}
|
||||
|
@ -238,30 +211,21 @@ void CMainMenu::OnSaveAs(HWND hWnd)
|
|||
|
||||
void CMainMenu::OnLodState(HWND hWnd)
|
||||
{
|
||||
char Directory[255], SaveFile[255];
|
||||
OPENFILENAME openfilename;
|
||||
|
||||
memset(&SaveFile, 0, sizeof(SaveFile));
|
||||
memset(&openfilename, 0, sizeof(openfilename));
|
||||
g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_LoadGame);
|
||||
|
||||
char Directory[255];
|
||||
UISettingsLoadStringVal(Directory_LastSave, Directory, sizeof(Directory));
|
||||
|
||||
openfilename.lStructSize = sizeof(openfilename);
|
||||
openfilename.hwndOwner = (HWND)hWnd;
|
||||
openfilename.lpstrFilter = "PJ64 Saves (*.zip, *.pj)\0*.pj?;*.pj;*.zip;";
|
||||
openfilename.lpstrFile = SaveFile;
|
||||
openfilename.lpstrInitialDir = Directory;
|
||||
openfilename.nMaxFile = MAX_PATH;
|
||||
openfilename.Flags = OFN_HIDEREADONLY;
|
||||
|
||||
g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_LoadGame);
|
||||
if (GetOpenFileName(&openfilename))
|
||||
CPath SaveFile;
|
||||
const char * Filter = "PJ64 Saves (*.zip, *.pj)\0*.pj?;*.pj;*.zip;";
|
||||
if (SaveFile.SelectFile(hWnd, Directory, Filter, false))
|
||||
{
|
||||
g_Settings->SaveString(GameRunning_InstantSaveFile, SaveFile);
|
||||
char SaveDir[MAX_PATH], drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
|
||||
_splitpath(SaveFile, drive, dir, fname, ext);
|
||||
_makepath(SaveDir, drive, dir, NULL, NULL);
|
||||
UISettingsSaveString(Directory_LastSave, SaveDir);
|
||||
if (!SaveFile.DirectoryExists())
|
||||
{
|
||||
SaveFile.DirectoryCreate();
|
||||
}
|
||||
UISettingsSaveString(Directory_LastSave, SaveFile.GetDriveDirectory());
|
||||
g_BaseSystem->ExternalEvent(SysEvent_LoadMachineState);
|
||||
}
|
||||
g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_LoadGame);
|
||||
|
@ -331,27 +295,15 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI
|
|||
break;
|
||||
case ID_SYSTEM_SWAPDISK:
|
||||
WriteTrace(TraceUserInterface, TraceDebug, "ID_SYSTEM_SWAPDISK");
|
||||
// Open Disk
|
||||
OPENFILENAME openfilename;
|
||||
char FileName[_MAX_PATH], Directory[_MAX_PATH];
|
||||
|
||||
memset(&FileName, 0, sizeof(FileName));
|
||||
memset(&openfilename, 0, sizeof(openfilename));
|
||||
|
||||
strcpy(Directory, g_Settings->LoadStringVal(RomList_GameDir).c_str());
|
||||
|
||||
openfilename.lStructSize = sizeof(openfilename);
|
||||
openfilename.hwndOwner = (HWND)hWnd;
|
||||
openfilename.lpstrFilter = "N64DD Disk Image (*.ndd)\0*.ndd\0All files (*.*)\0*.*\0";
|
||||
openfilename.lpstrFile = FileName;
|
||||
openfilename.lpstrInitialDir = Directory;
|
||||
openfilename.nMaxFile = MAX_PATH;
|
||||
openfilename.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
|
||||
|
||||
if (GetOpenFileName(&openfilename))
|
||||
{
|
||||
g_Disk->SaveDiskImage();
|
||||
g_Disk->SwapDiskImage(FileName);
|
||||
// Open Disk
|
||||
CPath FileName;
|
||||
const char * Filter = "N64DD Disk Image (*.ndd)\0*.ndd\0All files (*.*)\0*.*\0";
|
||||
if (FileName.SelectFile(hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
|
||||
{
|
||||
g_Disk->SaveDiskImage();
|
||||
g_Disk->SwapDiskImage(FileName);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ID_SYSTEM_SAVE:
|
||||
|
|
|
@ -86,7 +86,7 @@ private:
|
|||
std::wstring GetSaveSlotString(int Slot);
|
||||
stdstr GetFileLastMod(const CPath & FileName);
|
||||
void RebuildAccelerators(void);
|
||||
stdstr ChooseFileToOpen(HWND hParent);
|
||||
std::string ChooseFileToOpen(HWND hParent);
|
||||
void SetTraceModuleSetttings(SettingID Type);
|
||||
|
||||
static void SettingsChanged(CMainMenu * _this);
|
||||
|
|
|
@ -112,24 +112,12 @@ void CAdvancedOptionsPage::UpdatePageSettings(void)
|
|||
m_InUpdateSettings = false;
|
||||
}
|
||||
|
||||
void CAdvancedOptionsPage::SelectFile(LanguageStringID Title, CModifiedEditBox & EditBox)
|
||||
void CAdvancedOptionsPage::SelectFile(LanguageStringID /*Title*/, CModifiedEditBox & EditBox)
|
||||
{
|
||||
// Open DDROM
|
||||
OPENFILENAME openfilename;
|
||||
char FileName[_MAX_PATH], Directory[_MAX_PATH];
|
||||
memset(&FileName, 0, sizeof(FileName));
|
||||
memset(&openfilename, 0, sizeof(openfilename));
|
||||
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
|
||||
|
||||
strcpy(Directory, g_Settings->LoadStringVal(RomList_GameDir).c_str());
|
||||
openfilename.lStructSize = sizeof(openfilename);
|
||||
openfilename.hwndOwner = m_hWnd;
|
||||
openfilename.lpstrFilter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
|
||||
openfilename.lpstrFile = FileName;
|
||||
openfilename.lpstrInitialDir = Directory;
|
||||
openfilename.nMaxFile = MAX_PATH;
|
||||
openfilename.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
|
||||
|
||||
if (GetOpenFileName(&openfilename))
|
||||
CPath FileName;
|
||||
if (FileName.SelectFile(m_hWnd, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
|
||||
{
|
||||
EditBox.SetChanged(true);
|
||||
EditBox.SetWindowText(FileName);
|
||||
|
|
|
@ -90,7 +90,7 @@ LRESULT CSupportWindow::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*
|
|||
SetWindowLong(GWL_STYLE, dwStyle);
|
||||
|
||||
::EnableWindow(GetDlgItem(IDCANCEL), false);
|
||||
srand (time(NULL));
|
||||
srand ((uint32_t)time(NULL));
|
||||
SetTimer(0, ((rand() % 35) + 5) * 1000, NULL);
|
||||
}
|
||||
return TRUE;
|
||||
|
|
|
@ -40,21 +40,10 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
|
|||
stdstr IPLROM = g_Settings->LoadStringVal(File_DiskIPLPath);
|
||||
if ((IPLROM.length() <= 0) || (!CN64System::RunFileImage(IPLROM.c_str())))
|
||||
{
|
||||
// Open DDROM
|
||||
OPENFILENAME openfilename;
|
||||
char FileName[_MAX_PATH], Directory[_MAX_PATH];
|
||||
memset(&FileName, 0, sizeof(FileName));
|
||||
memset(&openfilename, 0, sizeof(openfilename));
|
||||
|
||||
openfilename.lStructSize = sizeof(openfilename);
|
||||
//openfilename.hwndOwner = (HWND)hWnd;
|
||||
openfilename.lpstrFilter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
|
||||
openfilename.lpstrFile = FileName;
|
||||
openfilename.lpstrInitialDir = Directory;
|
||||
openfilename.nMaxFile = MAX_PATH;
|
||||
openfilename.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
|
||||
|
||||
if (GetOpenFileName(&openfilename))
|
||||
CPath FileName;
|
||||
const char * Filter = "64DD IPL ROM Image (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0";
|
||||
if (FileName.SelectFile(NULL, g_Settings->LoadStringVal(RomList_GameDir).c_str(), Filter, true))
|
||||
{
|
||||
CN64System::RunFileImage(FileName);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue