PropertySheet: only allow 1 "afterclose" msg, which is done when the last page (that was accessed) is closed.

Problem:
. Config:   Change ComputerType
. Advanced: Load Saved-State
The 'Change ComputerType' msg is never posted.
This commit is contained in:
tomch 2012-03-31 21:34:02 +00:00
parent be71f901e0
commit 5478c4c9ed
16 changed files with 99 additions and 101 deletions

View File

@ -8,6 +8,6 @@ public:
protected: protected:
virtual BOOL DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam) = 0; virtual BOOL DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam) = 0;
virtual void DlgOK(HWND window, UINT afterclose) = 0; virtual void DlgOK(HWND window) = 0;
virtual void DlgCANCEL(HWND window) = 0; virtual void DlgCANCEL(HWND window) = 0;
}; };

View File

@ -5,8 +5,6 @@
CPageAdvanced* CPageAdvanced::ms_this = 0; // reinit'd in ctor CPageAdvanced* CPageAdvanced::ms_this = 0; // reinit'd in ctor
//static bool g_bConfirmedRestartEmulator = false;
enum CLONECHOICE {MENUITEM_CLONEMIN, MENUITEM_PRAVETS82=MENUITEM_CLONEMIN, MENUITEM_PRAVETS8M, MENUITEM_PRAVETS8A, MENUITEM_CLONEMAX}; enum CLONECHOICE {MENUITEM_CLONEMIN, MENUITEM_PRAVETS82=MENUITEM_CLONEMIN, MENUITEM_PRAVETS8M, MENUITEM_PRAVETS8A, MENUITEM_CLONEMAX};
const TCHAR CPageAdvanced::m_CloneChoices[] = const TCHAR CPageAdvanced::m_CloneChoices[] =
TEXT("Pravets 82\0") // Bulgarian TEXT("Pravets 82\0") // Bulgarian
@ -22,8 +20,6 @@ BOOL CALLBACK CPageAdvanced::DlgProc(HWND window, UINT message, WPARAM wparam, L
BOOL CPageAdvanced::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam) BOOL CPageAdvanced::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam)
{ {
static UINT afterclose = 0;
switch (message) switch (message)
{ {
case WM_NOTIFY: case WM_NOTIFY:
@ -34,6 +30,7 @@ BOOL CPageAdvanced::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LP
{ {
case PSN_SETACTIVE: case PSN_SETACTIVE:
// About to become the active page // About to become the active page
m_PropertySheetHelper.SetLastPage(m_Page);
InitFreezeDlgButton(window); InitFreezeDlgButton(window);
InitCloneDropdownMenu(window); InitCloneDropdownMenu(window);
break; break;
@ -41,7 +38,7 @@ BOOL CPageAdvanced::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LP
SetWindowLong(window, DWL_MSGRESULT, FALSE); // Changes are valid SetWindowLong(window, DWL_MSGRESULT, FALSE); // Changes are valid
break; break;
case PSN_APPLY: case PSN_APPLY:
DlgOK(window, afterclose); DlgOK(window);
SetWindowLong(window, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid SetWindowLong(window, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid
break; break;
case PSN_QUERYCANCEL: case PSN_QUERYCANCEL:
@ -72,10 +69,10 @@ BOOL CPageAdvanced::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LP
case IDC_SAVESTATE_ON_EXIT: case IDC_SAVESTATE_ON_EXIT:
break; break;
case IDC_SAVESTATE: case IDC_SAVESTATE:
afterclose = WM_USER_SAVESTATE; m_uAfterClose = WM_USER_SAVESTATE;
break; break;
case IDC_LOADSTATE: case IDC_LOADSTATE:
afterclose = WM_USER_LOADSTATE; m_uAfterClose = WM_USER_LOADSTATE;
break; break;
// //
@ -92,7 +89,7 @@ BOOL CPageAdvanced::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LP
&& m_PropertySheetHelper.IsOkToRestart(window) ) && m_PropertySheetHelper.IsOkToRestart(window) )
{ {
m_uTheFreezesF8Rom = uNewState; m_uTheFreezesF8Rom = uNewState;
afterclose = WM_USER_RESTART; m_uAfterClose = WM_USER_RESTART;
PropSheet_PressButton(GetParent(window), PSBTN_OK); PropSheet_PressButton(GetParent(window), PSBTN_OK);
} }
else else
@ -106,8 +103,6 @@ BOOL CPageAdvanced::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LP
case WM_INITDIALOG: //Init advanced settings dialog case WM_INITDIALOG: //Init advanced settings dialog
{ {
m_PropertySheetHelper.SetLastPage(m_Page);
SendDlgItemMessage(window,IDC_SAVESTATE_FILENAME,WM_SETTEXT,0,(LPARAM)Snapshot_GetFilename()); SendDlgItemMessage(window,IDC_SAVESTATE_FILENAME,WM_SETTEXT,0,(LPARAM)Snapshot_GetFilename());
CheckDlgButton(window, IDC_SAVESTATE_ON_EXIT, g_bSaveStateOnExit ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(window, IDC_SAVESTATE_ON_EXIT, g_bSaveStateOnExit ? BST_CHECKED : BST_UNCHECKED);
@ -127,7 +122,7 @@ BOOL CPageAdvanced::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LP
// Need to specific cmd-line switch: -printer-real to enable this control // Need to specific cmd-line switch: -printer-real to enable this control
EnableWindow(GetDlgItem(window, IDC_DUMPTOPRINTER), g_bEnableDumpToRealPrinter ? TRUE : FALSE); EnableWindow(GetDlgItem(window, IDC_DUMPTOPRINTER), g_bEnableDumpToRealPrinter ? TRUE : FALSE);
afterclose = 0; m_uAfterClose = 0;
break; break;
} }
} }
@ -135,7 +130,7 @@ BOOL CPageAdvanced::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LP
return FALSE; return FALSE;
} }
void CPageAdvanced::DlgOK(HWND window, UINT afterclose) void CPageAdvanced::DlgOK(HWND window)
{ {
// Update save-state filename // Update save-state filename
{ {
@ -195,19 +190,16 @@ void CPageAdvanced::DlgOK(HWND window, UINT afterclose)
const DWORD NewCloneMenuItem = (DWORD) SendDlgItemMessage(window, IDC_CLONETYPE, CB_GETCURSEL, 0, 0); const DWORD NewCloneMenuItem = (DWORD) SendDlgItemMessage(window, IDC_CLONETYPE, CB_GETCURSEL, 0, 0);
const eApple2Type NewCloneType = GetCloneType(NewCloneMenuItem); const eApple2Type NewCloneType = GetCloneType(NewCloneMenuItem);
// Second msgbox fails: // Get 2 identical msg-boxs:
// . Config tab: Change to 'Clone' // . Config tab: Change to 'Clone'
// . Advanced tab: Change clone type, then OK // . Advanced tab: Change clone type, then OK
// . ConfigDlg_OK() msgbox asks "restart now?", click OK // . ConfigDlg_OK() msgbox asks "restart now?", click OK
// . AdvancedDlg_OK() msgbox fails: GetLastError(): ERROR_INVALID_WINDOW_HANDLE; 1400 (0x578) // . AdvancedDlg_OK() msgbox asks "restart now?
// - Probably because ConfigDlg_OK() has already posted WM_USER_RESTART
// - So I added g_bConfirmedRestartEmulator
if (IS_CLONE() || (m_PropertySheetHelper.GetUIControlCloneDropdownMenu() == UI_ENABLE)) if (IS_CLONE() || (m_PropertySheetHelper.GetUIControlCloneDropdownMenu() == UI_ENABLE))
{ {
if (NewCloneType != g_Apple2Type) if (NewCloneType != g_Apple2Type)
{ {
if ((afterclose == WM_USER_RESTART) || // Eg. Changing 'Freeze ROM' & user has already OK'd the restart for this if ((m_uAfterClose == WM_USER_RESTART) || // Eg. Changing 'Freeze ROM' & user has already OK'd the restart for this
// g_bConfirmedRestartEmulator || // See above
((MessageBox(window, ((MessageBox(window,
TEXT( TEXT(
"You have changed the emulated computer " "You have changed the emulated computer "
@ -219,7 +211,7 @@ void CPageAdvanced::DlgOK(HWND window, UINT afterclose)
MB_ICONQUESTION | MB_OKCANCEL | MB_SETFOREGROUND) == IDOK) MB_ICONQUESTION | MB_OKCANCEL | MB_SETFOREGROUND) == IDOK)
&& m_PropertySheetHelper.IsOkToRestart(window)) ) && m_PropertySheetHelper.IsOkToRestart(window)) )
{ {
afterclose = WM_USER_RESTART; m_uAfterClose = WM_USER_RESTART;
m_PropertySheetHelper.SaveComputerType(NewCloneType); m_PropertySheetHelper.SaveComputerType(NewCloneType);
} }
} }
@ -228,13 +220,7 @@ void CPageAdvanced::DlgOK(HWND window, UINT afterclose)
if (g_Apple2Type > A2TYPE_APPLE2PLUS) if (g_Apple2Type > A2TYPE_APPLE2PLUS)
m_uTheFreezesF8Rom = 0; m_uTheFreezesF8Rom = 0;
// m_PropertySheetHelper.PostMsgAfterClose(m_Page, m_uAfterClose);
// if (g_bConfirmedRestartEmulator)
// return; // ConfigDlg_OK() has already posted WM_USER_RESTART
if (afterclose)
PostMessage(g_hFrameWindow,afterclose,0,0);
} }
// Advanced->Clone: Menu item to eApple2Type // Advanced->Clone: Menu item to eApple2Type

View File

@ -10,6 +10,7 @@ public:
CPageAdvanced(CPropertySheetHelper& PropertySheetHelper) : CPageAdvanced(CPropertySheetHelper& PropertySheetHelper) :
m_Page(PG_ADVANCED), m_Page(PG_ADVANCED),
m_PropertySheetHelper(PropertySheetHelper), m_PropertySheetHelper(PropertySheetHelper),
m_uAfterClose(0),
m_uTheFreezesF8Rom(0) m_uTheFreezesF8Rom(0)
{ {
CPageAdvanced::ms_this = this; CPageAdvanced::ms_this = this;
@ -24,7 +25,7 @@ public:
protected: protected:
// IPropertySheetPage // IPropertySheetPage
virtual BOOL DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam); virtual BOOL DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam);
virtual void DlgOK(HWND window, UINT afterclose); virtual void DlgOK(HWND window);
virtual void DlgCANCEL(HWND window){} virtual void DlgCANCEL(HWND window){}
private: private:
@ -38,5 +39,6 @@ private:
const PAGETYPE m_Page; const PAGETYPE m_Page;
CPropertySheetHelper& m_PropertySheetHelper; CPropertySheetHelper& m_PropertySheetHelper;
UINT m_uAfterClose;
UINT m_uTheFreezesF8Rom; UINT m_uTheFreezesF8Rom;
}; };

View File

@ -21,8 +21,6 @@ BOOL CALLBACK CPageConfig::DlgProc(HWND window, UINT message, WPARAM wparam, LPA
BOOL CPageConfig::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam) BOOL CPageConfig::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam)
{ {
static UINT afterclose = 0;
switch (message) switch (message)
{ {
case WM_NOTIFY: case WM_NOTIFY:
@ -31,6 +29,10 @@ BOOL CPageConfig::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPAR
switch (((LPPSHNOTIFY)lparam)->hdr.code) switch (((LPPSHNOTIFY)lparam)->hdr.code)
{ {
case PSN_SETACTIVE:
// About to become the active page
m_PropertySheetHelper.SetLastPage(m_Page);
break;
case PSN_KILLACTIVE: case PSN_KILLACTIVE:
// About to stop being active page // About to stop being active page
{ {
@ -41,7 +43,7 @@ BOOL CPageConfig::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPAR
} }
break; break;
case PSN_APPLY: case PSN_APPLY:
DlgOK(window, afterclose); DlgOK(window);
SetWindowLong(window, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid SetWindowLong(window, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid
break; break;
case PSN_QUERYCANCEL: case PSN_QUERYCANCEL:
@ -73,7 +75,7 @@ BOOL CPageConfig::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPAR
break; break;
case IDC_BENCHMARK: case IDC_BENCHMARK:
afterclose = WM_USER_BENCHMARK; m_uAfterClose = WM_USER_BENCHMARK;
PropSheet_PressButton(GetParent(window), PSBTN_OK); PropSheet_PressButton(GetParent(window), PSBTN_OK);
break; break;
@ -98,7 +100,7 @@ BOOL CPageConfig::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPAR
TEXT("Configuration"), TEXT("Configuration"),
MB_ICONQUESTION | MB_OKCANCEL | MB_SETFOREGROUND) == IDOK) MB_ICONQUESTION | MB_OKCANCEL | MB_SETFOREGROUND) == IDOK)
{ {
afterclose = WM_USER_RESTART; m_uAfterClose = WM_USER_RESTART;
PropSheet_PressButton(GetParent(window), PSBTN_OK); PropSheet_PressButton(GetParent(window), PSBTN_OK);
} }
break; break;
@ -112,8 +114,6 @@ BOOL CPageConfig::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPAR
case WM_INITDIALOG: //Init general settings dialog case WM_INITDIALOG: //Init general settings dialog
{ {
m_PropertySheetHelper.SetLastPage(m_Page);
// Convert Apple2 type to menu item // Convert Apple2 type to menu item
{ {
int nCurrentChoice = 0; int nCurrentChoice = 0;
@ -154,7 +154,7 @@ BOOL CPageConfig::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPAR
EnableTrackbar(window, bCustom); EnableTrackbar(window, bCustom);
} }
afterclose = 0; m_uAfterClose = 0;
break; break;
} }
@ -184,7 +184,7 @@ BOOL CPageConfig::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPAR
return FALSE; return FALSE;
} }
void CPageConfig::DlgOK(HWND window, UINT afterclose) void CPageConfig::DlgOK(HWND window)
{ {
const DWORD NewComputerMenuItem = (DWORD) SendDlgItemMessage(window,IDC_COMPUTER,CB_GETCURSEL,0,0); const DWORD NewComputerMenuItem = (DWORD) SendDlgItemMessage(window,IDC_COMPUTER,CB_GETCURSEL,0,0);
const DWORD newvidtype = (DWORD)SendDlgItemMessage(window,IDC_VIDEOTYPE,CB_GETCURSEL,0,0); const DWORD newvidtype = (DWORD)SendDlgItemMessage(window,IDC_VIDEOTYPE,CB_GETCURSEL,0,0);
@ -195,8 +195,7 @@ void CPageConfig::DlgOK(HWND window, UINT afterclose)
if (NewApple2Type != OldApple2Type) if (NewApple2Type != OldApple2Type)
{ {
if ((afterclose == WM_USER_RESTART) || // Eg. Changing 'Freeze ROM' & user has already OK'd the restart for this if ((MessageBox(window,
((MessageBox(window,
TEXT( TEXT(
"You have changed the emulated computer " "You have changed the emulated computer "
"type. This change will not take effect " "type. This change will not take effect "
@ -205,10 +204,9 @@ void CPageConfig::DlgOK(HWND window, UINT afterclose)
"Would you like to restart the emulator now?"), "Would you like to restart the emulator now?"),
TEXT("Configuration"), TEXT("Configuration"),
MB_ICONQUESTION | MB_OKCANCEL | MB_SETFOREGROUND) == IDOK) MB_ICONQUESTION | MB_OKCANCEL | MB_SETFOREGROUND) == IDOK)
&& m_PropertySheetHelper.IsOkToRestart(window)) ) && m_PropertySheetHelper.IsOkToRestart(window))
{ {
//g_bConfirmedRestartEmulator = true; m_uAfterClose = WM_USER_RESTART;
afterclose = WM_USER_RESTART;
m_PropertySheetHelper.SaveComputerType(NewApple2Type); m_PropertySheetHelper.SaveComputerType(NewApple2Type);
} }
} }
@ -242,10 +240,7 @@ void CPageConfig::DlgOK(HWND window, UINT afterclose)
Config_Save_Video(); Config_Save_Video();
// m_PropertySheetHelper.PostMsgAfterClose(m_Page, m_uAfterClose);
if (afterclose)
PostMessage(g_hFrameWindow,afterclose,0,0);
} }
// Config->Computer: Menu item to eApple2Type // Config->Computer: Menu item to eApple2Type

View File

@ -10,7 +10,8 @@ class CPageConfig : public IPropertySheetPage
public: public:
CPageConfig(CPropertySheetHelper& PropertySheetHelper) : CPageConfig(CPropertySheetHelper& PropertySheetHelper) :
m_Page(PG_CONFIG), m_Page(PG_CONFIG),
m_PropertySheetHelper(PropertySheetHelper) m_PropertySheetHelper(PropertySheetHelper),
m_uAfterClose(0)
{ {
CPageConfig::ms_this = this; CPageConfig::ms_this = this;
} }
@ -21,7 +22,7 @@ public:
protected: protected:
// IPropertySheetPage // IPropertySheetPage
virtual BOOL DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam); virtual BOOL DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam);
virtual void DlgOK(HWND window, UINT afterclose); virtual void DlgOK(HWND window);
virtual void DlgCANCEL(HWND window){} virtual void DlgCANCEL(HWND window){}
private: private:
@ -34,5 +35,6 @@ private:
const PAGETYPE m_Page; const PAGETYPE m_Page;
CPropertySheetHelper& m_PropertySheetHelper; CPropertySheetHelper& m_PropertySheetHelper;
UINT m_uAfterClose;
CPageConfigTfe m_PageConfigTfe; CPageConfigTfe m_PageConfigTfe;
}; };

View File

@ -44,7 +44,7 @@ BOOL CPageConfigTfe::DlgProcInternal(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
switch (LOWORD(wparam)) switch (LOWORD(wparam))
{ {
case IDOK: case IDOK:
DlgOK(hwnd, 0); DlgOK(hwnd);
/* FALL THROUGH */ /* FALL THROUGH */
case IDCANCEL: case IDCANCEL:
@ -72,7 +72,7 @@ BOOL CPageConfigTfe::DlgProcInternal(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
return FALSE; return FALSE;
} }
void CPageConfigTfe::DlgOK(HWND window, UINT afterclose) void CPageConfigTfe::DlgOK(HWND window)
{ {
save_tfe_dialog(window); save_tfe_dialog(window);
} }

View File

@ -17,7 +17,7 @@ public:
protected: protected:
// IPropertySheetPage // IPropertySheetPage
virtual BOOL DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam); virtual BOOL DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam);
virtual void DlgOK(HWND window, UINT afterclose); virtual void DlgOK(HWND window);
virtual void DlgCANCEL(HWND window); virtual void DlgCANCEL(HWND window);
private: private:

View File

@ -19,8 +19,6 @@ BOOL CALLBACK CPageDisk::DlgProc(HWND window, UINT message, WPARAM wparam, LPARA
BOOL CPageDisk::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam) BOOL CPageDisk::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam)
{ {
static UINT afterclose = 0;
switch (message) switch (message)
{ {
case WM_NOTIFY: case WM_NOTIFY:
@ -29,11 +27,15 @@ BOOL CPageDisk::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM
switch (((LPPSHNOTIFY)lparam)->hdr.code) switch (((LPPSHNOTIFY)lparam)->hdr.code)
{ {
case PSN_SETACTIVE:
// About to become the active page
m_PropertySheetHelper.SetLastPage(m_Page);
break;
case PSN_KILLACTIVE: case PSN_KILLACTIVE:
SetWindowLong(window, DWL_MSGRESULT, FALSE); // Changes are valid SetWindowLong(window, DWL_MSGRESULT, FALSE); // Changes are valid
break; break;
case PSN_APPLY: case PSN_APPLY:
DlgOK(window, afterclose); DlgOK(window);
SetWindowLong(window, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid SetWindowLong(window, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid
break; break;
case PSN_QUERYCANCEL: case PSN_QUERYCANCEL:
@ -93,8 +95,6 @@ BOOL CPageDisk::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM
case WM_INITDIALOG: //Init disk settings dialog case WM_INITDIALOG: //Init disk settings dialog
{ {
m_PropertySheetHelper.SetLastPage(m_Page);
m_PropertySheetHelper.FillComboBox(window,IDC_DISKTYPE,m_discchoices,enhancedisk); m_PropertySheetHelper.FillComboBox(window,IDC_DISKTYPE,m_discchoices,enhancedisk);
SendDlgItemMessage(window,IDC_EDIT_DISK1,WM_SETTEXT,0,(LPARAM)DiskGetFullName(DRIVE_1)); SendDlgItemMessage(window,IDC_EDIT_DISK1,WM_SETTEXT,0,(LPARAM)DiskGetFullName(DRIVE_1));
@ -115,7 +115,7 @@ BOOL CPageDisk::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM
EnableHDD(window, IsDlgButtonChecked(window, IDC_HDD_ENABLE)); EnableHDD(window, IsDlgButtonChecked(window, IDC_HDD_ENABLE));
afterclose = 0; m_uAfterClose = 0;
break; break;
} }
@ -216,7 +216,7 @@ BOOL CPageDisk::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM
return FALSE; return FALSE;
} }
void CPageDisk::DlgOK(HWND window, UINT afterclose) void CPageDisk::DlgOK(HWND window)
{ {
BOOL newdisktype = (BOOL) SendDlgItemMessage(window,IDC_DISKTYPE,CB_GETCURSEL,0,0); BOOL newdisktype = (BOOL) SendDlgItemMessage(window,IDC_DISKTYPE,CB_GETCURSEL,0,0);
@ -230,7 +230,7 @@ void CPageDisk::DlgOK(HWND window, UINT afterclose)
TEXT("Would you like to restart the emulator now?"), TEXT("Would you like to restart the emulator now?"),
TEXT("Configuration"), TEXT("Configuration"),
MB_ICONQUESTION | MB_OKCANCEL | MB_SETFOREGROUND) == IDOK) MB_ICONQUESTION | MB_OKCANCEL | MB_SETFOREGROUND) == IDOK)
afterclose = WM_USER_RESTART; m_uAfterClose = WM_USER_RESTART;
} }
bool bHDDIsEnabled = IsDlgButtonChecked(window, IDC_HDD_ENABLE) ? true : false; bool bHDDIsEnabled = IsDlgButtonChecked(window, IDC_HDD_ENABLE) ? true : false;
@ -242,10 +242,7 @@ void CPageDisk::DlgOK(HWND window, UINT afterclose)
RegSaveString(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_LAST_HARDDISK_1), 1, HD_GetFullPathName(HARDDISK_1)); RegSaveString(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_LAST_HARDDISK_1), 1, HD_GetFullPathName(HARDDISK_1));
RegSaveString(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_LAST_HARDDISK_2), 1, HD_GetFullPathName(HARDDISK_2)); RegSaveString(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_LAST_HARDDISK_2), 1, HD_GetFullPathName(HARDDISK_2));
// m_PropertySheetHelper.PostMsgAfterClose(m_Page, m_uAfterClose);
if (afterclose)
PostMessage(g_hFrameWindow,afterclose,0,0);
} }
void CPageDisk::EnableHDD(HWND window, BOOL bEnable) void CPageDisk::EnableHDD(HWND window, BOOL bEnable)

View File

@ -9,7 +9,8 @@ class CPageDisk : public IPropertySheetPage
public: public:
CPageDisk(CPropertySheetHelper& PropertySheetHelper) : CPageDisk(CPropertySheetHelper& PropertySheetHelper) :
m_Page(PG_DISK), m_Page(PG_DISK),
m_PropertySheetHelper(PropertySheetHelper) m_PropertySheetHelper(PropertySheetHelper),
m_uAfterClose(0)
{ {
CPageDisk::ms_this = this; CPageDisk::ms_this = this;
} }
@ -20,7 +21,7 @@ public:
protected: protected:
// IPropertySheetPage // IPropertySheetPage
virtual BOOL DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam); virtual BOOL DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam);
virtual void DlgOK(HWND window, UINT afterclose); virtual void DlgOK(HWND window);
virtual void DlgCANCEL(HWND window){} virtual void DlgCANCEL(HWND window){}
private: private:
@ -31,4 +32,5 @@ private:
const PAGETYPE m_Page; const PAGETYPE m_Page;
CPropertySheetHelper& m_PropertySheetHelper; CPropertySheetHelper& m_PropertySheetHelper;
UINT m_uAfterClose;
}; };

View File

@ -40,7 +40,6 @@ BOOL CALLBACK CPageInput::DlgProc(HWND window, UINT message, WPARAM wparam, LPAR
BOOL CPageInput::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam) BOOL CPageInput::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam)
{ {
static UINT afterclose = 0;
m_MousecardSlotChange = CARD_UNCHANGED; m_MousecardSlotChange = CARD_UNCHANGED;
m_CPMcardSlotChange = CARD_UNCHANGED; m_CPMcardSlotChange = CARD_UNCHANGED;
@ -52,11 +51,15 @@ BOOL CPageInput::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARA
switch (((LPPSHNOTIFY)lparam)->hdr.code) switch (((LPPSHNOTIFY)lparam)->hdr.code)
{ {
case PSN_SETACTIVE:
// About to become the active page
m_PropertySheetHelper.SetLastPage(m_Page);
break;
case PSN_KILLACTIVE: case PSN_KILLACTIVE:
SetWindowLong(window, DWL_MSGRESULT, FALSE); // Changes are valid SetWindowLong(window, DWL_MSGRESULT, FALSE); // Changes are valid
break; break;
case PSN_APPLY: case PSN_APPLY:
DlgOK(window, afterclose); DlgOK(window);
SetWindowLong(window, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid SetWindowLong(window, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid
break; break;
case PSN_QUERYCANCEL: case PSN_QUERYCANCEL:
@ -140,7 +143,7 @@ BOOL CPageInput::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARA
InitJoystickChoices(window, JN_JOYSTICK1, IDC_JOYSTICK1); InitJoystickChoices(window, JN_JOYSTICK1, IDC_JOYSTICK1);
} }
afterclose = WM_USER_RESTART; m_uAfterClose = WM_USER_RESTART;
PropSheet_PressButton(GetParent(window), PSBTN_OK); PropSheet_PressButton(GetParent(window), PSBTN_OK);
} }
else else
@ -176,7 +179,7 @@ BOOL CPageInput::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARA
m_CPMcardSlotChange = (NewCPMChoice == CPM_UNPLUGGED) ? CARD_UNPLUGGED : CARD_INSERTED; m_CPMcardSlotChange = (NewCPMChoice == CPM_UNPLUGGED) ? CARD_UNPLUGGED : CARD_INSERTED;
m_CPMChoice = NewCPMChoice; m_CPMChoice = NewCPMChoice;
afterclose = WM_USER_RESTART; m_uAfterClose = WM_USER_RESTART;
PropSheet_PressButton(GetParent(window), PSBTN_OK); PropSheet_PressButton(GetParent(window), PSBTN_OK);
} }
else else
@ -195,8 +198,6 @@ BOOL CPageInput::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARA
case WM_INITDIALOG: //Init input settings dialog case WM_INITDIALOG: //Init input settings dialog
{ {
m_PropertySheetHelper.SetLastPage(m_Page);
InitJoystickChoices(window, JN_JOYSTICK0, IDC_JOYSTICK0); InitJoystickChoices(window, JN_JOYSTICK0, IDC_JOYSTICK0);
InitJoystickChoices(window, JN_JOYSTICK1, IDC_JOYSTICK1); InitJoystickChoices(window, JN_JOYSTICK1, IDC_JOYSTICK1);
@ -220,7 +221,7 @@ BOOL CPageInput::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARA
InitCPMChoices(window); InitCPMChoices(window);
afterclose = 0; m_uAfterClose = 0;
break; break;
} }
} }
@ -228,20 +229,20 @@ BOOL CPageInput::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARA
return FALSE; return FALSE;
} }
void CPageInput::DlgOK(HWND window, UINT afterclose) void CPageInput::DlgOK(HWND window)
{ {
UINT uNewJoyType0 = SendDlgItemMessage(window,IDC_JOYSTICK0,CB_GETCURSEL,0,0); UINT uNewJoyType0 = SendDlgItemMessage(window,IDC_JOYSTICK0,CB_GETCURSEL,0,0);
UINT uNewJoyType1 = SendDlgItemMessage(window,IDC_JOYSTICK1,CB_GETCURSEL,0,0); UINT uNewJoyType1 = SendDlgItemMessage(window,IDC_JOYSTICK1,CB_GETCURSEL,0,0);
if (!JoySetEmulationType(window, m_nJoy0ChoiceTranlationTbl[uNewJoyType0], JN_JOYSTICK0)) if (!JoySetEmulationType(window, m_nJoy0ChoiceTranlationTbl[uNewJoyType0], JN_JOYSTICK0))
{ {
//afterclose = 0; // TC: does nothing m_uAfterClose = 0;
return; return;
} }
if (!JoySetEmulationType(window, m_nJoy1ChoiceTranlationTbl[uNewJoyType1], JN_JOYSTICK1)) if (!JoySetEmulationType(window, m_nJoy1ChoiceTranlationTbl[uNewJoyType1], JN_JOYSTICK1))
{ {
//afterclose = 0; // TC: does nothing m_uAfterClose = 0;
return; return;
} }
@ -281,10 +282,7 @@ void CPageInput::DlgOK(HWND window, UINT afterclose)
m_PropertySheetHelper.SetSlot5(CT_Z80); m_PropertySheetHelper.SetSlot5(CT_Z80);
} }
// m_PropertySheetHelper.PostMsgAfterClose(m_Page, m_uAfterClose);
if (afterclose)
PostMessage(g_hFrameWindow,afterclose,0,0);
} }
void CPageInput::InitJoystickChoices(HWND window, int nJoyNum, int nIdcValue) void CPageInput::InitJoystickChoices(HWND window, int nJoyNum, int nIdcValue)

View File

@ -10,6 +10,7 @@ public:
CPageInput(CPropertySheetHelper& PropertySheetHelper) : CPageInput(CPropertySheetHelper& PropertySheetHelper) :
m_Page(PG_INPUT), m_Page(PG_INPUT),
m_PropertySheetHelper(PropertySheetHelper), m_PropertySheetHelper(PropertySheetHelper),
m_uAfterClose(0),
m_MousecardSlotChange(CARD_UNCHANGED), m_MousecardSlotChange(CARD_UNCHANGED),
m_CPMcardSlotChange(CARD_UNCHANGED), m_CPMcardSlotChange(CARD_UNCHANGED),
m_uScrollLockToggle(0), m_uScrollLockToggle(0),
@ -33,7 +34,7 @@ public:
protected: protected:
// IPropertySheetPage // IPropertySheetPage
virtual BOOL DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam); virtual BOOL DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam);
virtual void DlgOK(HWND window, UINT afterclose); virtual void DlgOK(HWND window);
virtual void DlgCANCEL(HWND window){} virtual void DlgCANCEL(HWND window){}
private: private:
@ -66,6 +67,7 @@ private:
const PAGETYPE m_Page; const PAGETYPE m_Page;
CPropertySheetHelper& m_PropertySheetHelper; CPropertySheetHelper& m_PropertySheetHelper;
UINT m_uAfterClose;
CARDSTATE m_MousecardSlotChange; CARDSTATE m_MousecardSlotChange;
CARDSTATE m_CPMcardSlotChange; CARDSTATE m_CPMcardSlotChange;

View File

@ -19,8 +19,6 @@ BOOL CALLBACK CPageSound::DlgProc(HWND window, UINT message, WPARAM wparam, LPAR
BOOL CPageSound::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam) BOOL CPageSound::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam)
{ {
static UINT afterclose = 0;
switch (message) switch (message)
{ {
case WM_NOTIFY: case WM_NOTIFY:
@ -29,11 +27,15 @@ BOOL CPageSound::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARA
switch (((LPPSHNOTIFY)lparam)->hdr.code) switch (((LPPSHNOTIFY)lparam)->hdr.code)
{ {
case PSN_SETACTIVE:
// About to become the active page
m_PropertySheetHelper.SetLastPage(m_Page);
break;
case PSN_KILLACTIVE: case PSN_KILLACTIVE:
SetWindowLong(window, DWL_MSGRESULT, FALSE); // Changes are valid SetWindowLong(window, DWL_MSGRESULT, FALSE); // Changes are valid
break; break;
case PSN_APPLY: case PSN_APPLY:
DlgOK(window, afterclose); DlgOK(window);
SetWindowLong(window, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid SetWindowLong(window, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid
break; break;
case PSN_QUERYCANCEL: case PSN_QUERYCANCEL:
@ -58,7 +60,7 @@ BOOL CPageSound::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARA
LPCSTR pMsg = TEXT("The emulator needs to restart as the slot configuration has changed.\n") LPCSTR pMsg = TEXT("The emulator needs to restart as the slot configuration has changed.\n")
TEXT("Mockingboard cards will be inserted into slots 4 & 5.\n\n") TEXT("Mockingboard cards will be inserted into slots 4 & 5.\n\n")
TEXT("Would you like to restart the emulator now?"); TEXT("Would you like to restart the emulator now?");
if (NewSoundcardConfigured(window, wparam, pMsg, afterclose)) if (NewSoundcardConfigured(window, wparam, pMsg))
{ {
m_NewCardType = CT_MockingboardC; m_NewCardType = CT_MockingboardC;
m_SoundcardSlotChange = CARD_INSERTED; m_SoundcardSlotChange = CARD_INSERTED;
@ -71,7 +73,7 @@ BOOL CPageSound::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARA
LPCSTR pMsg = TEXT("The emulator needs to restart as the slot configuration has changed.\n") LPCSTR pMsg = TEXT("The emulator needs to restart as the slot configuration has changed.\n")
TEXT("Phasor card will be inserted into slot 4.\n\n") TEXT("Phasor card will be inserted into slot 4.\n\n")
TEXT("Would you like to restart the emulator now?"); TEXT("Would you like to restart the emulator now?");
if (NewSoundcardConfigured(window, wparam, pMsg, afterclose)) if (NewSoundcardConfigured(window, wparam, pMsg))
{ {
m_NewCardType = CT_Phasor; m_NewCardType = CT_Phasor;
m_SoundcardSlotChange = CARD_INSERTED; m_SoundcardSlotChange = CARD_INSERTED;
@ -84,7 +86,7 @@ BOOL CPageSound::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARA
LPCSTR pMsg = TEXT("The emulator needs to restart as the slot configuration has changed.\n") LPCSTR pMsg = TEXT("The emulator needs to restart as the slot configuration has changed.\n")
TEXT("Sound card(s) will be removed.\n\n") TEXT("Sound card(s) will be removed.\n\n")
TEXT("Would you like to restart the emulator now?"); TEXT("Would you like to restart the emulator now?");
if (NewSoundcardConfigured(window, wparam, pMsg, afterclose)) if (NewSoundcardConfigured(window, wparam, pMsg))
{ {
m_NewCardType = CT_Empty; m_NewCardType = CT_Empty;
m_SoundcardSlotChange = CARD_UNPLUGGED; m_SoundcardSlotChange = CARD_UNPLUGGED;
@ -97,8 +99,6 @@ BOOL CPageSound::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARA
case WM_INITDIALOG: case WM_INITDIALOG:
{ {
m_PropertySheetHelper.SetLastPage(m_Page);
m_PropertySheetHelper.FillComboBox(window,IDC_SOUNDTYPE,m_soundchoices,soundtype); m_PropertySheetHelper.FillComboBox(window,IDC_SOUNDTYPE,m_soundchoices,soundtype);
SendDlgItemMessage(window,IDC_SPKR_VOLUME,TBM_SETRANGE,1,MAKELONG(VOLUME_MIN,VOLUME_MAX)); SendDlgItemMessage(window,IDC_SPKR_VOLUME,TBM_SETRANGE,1,MAKELONG(VOLUME_MIN,VOLUME_MAX));
@ -131,7 +131,7 @@ BOOL CPageSound::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARA
EnableWindow(GetDlgItem(window, IDC_MB_VOLUME), (m_nCurrentIDCheckButton != IDC_SOUNDCARD_DISABLE) ? TRUE : FALSE); EnableWindow(GetDlgItem(window, IDC_MB_VOLUME), (m_nCurrentIDCheckButton != IDC_SOUNDCARD_DISABLE) ? TRUE : FALSE);
afterclose = 0; m_uAfterClose = 0;
break; break;
} }
} }
@ -139,7 +139,7 @@ BOOL CPageSound::DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARA
return FALSE; return FALSE;
} }
void CPageSound::DlgOK(HWND window, UINT afterclose) void CPageSound::DlgOK(HWND window)
{ {
DWORD newsoundtype = (DWORD)SendDlgItemMessage(window,IDC_SOUNDTYPE,CB_GETCURSEL,0,0); DWORD newsoundtype = (DWORD)SendDlgItemMessage(window,IDC_SOUNDTYPE,CB_GETCURSEL,0,0);
@ -148,7 +148,7 @@ void CPageSound::DlgOK(HWND window, UINT afterclose)
if (!SpkrSetEmulationType(window,newsoundtype)) if (!SpkrSetEmulationType(window,newsoundtype))
{ {
//afterclose = 0; // TC: does nothing m_uAfterClose = 0;
return; return;
} }
@ -183,13 +183,10 @@ void CPageSound::DlgOK(HWND window, UINT afterclose)
} }
} }
// m_PropertySheetHelper.PostMsgAfterClose(m_Page, m_uAfterClose);
if (afterclose)
PostMessage(g_hFrameWindow,afterclose,0,0);
} }
bool CPageSound::NewSoundcardConfigured(HWND window, WPARAM wparam, LPCSTR pMsg, UINT& afterclose) bool CPageSound::NewSoundcardConfigured(HWND window, WPARAM wparam, LPCSTR pMsg)
{ {
if (HIWORD(wparam) != BN_CLICKED) if (HIWORD(wparam) != BN_CLICKED)
return false; return false;
@ -204,7 +201,7 @@ bool CPageSound::NewSoundcardConfigured(HWND window, WPARAM wparam, LPCSTR pMsg,
&& m_PropertySheetHelper.IsOkToRestart(window) ) && m_PropertySheetHelper.IsOkToRestart(window) )
{ {
m_nCurrentIDCheckButton = LOWORD(wparam); m_nCurrentIDCheckButton = LOWORD(wparam);
afterclose = WM_USER_RESTART; m_uAfterClose = WM_USER_RESTART;
PropSheet_PressButton(GetParent(window), PSBTN_OK); PropSheet_PressButton(GetParent(window), PSBTN_OK);
return true; return true;
} }

View File

@ -10,6 +10,7 @@ public:
CPageSound(CPropertySheetHelper& PropertySheetHelper) : CPageSound(CPropertySheetHelper& PropertySheetHelper) :
m_Page(PG_SOUND), m_Page(PG_SOUND),
m_PropertySheetHelper(PropertySheetHelper), m_PropertySheetHelper(PropertySheetHelper),
m_uAfterClose(0),
m_NewCardType(CT_Empty), m_NewCardType(CT_Empty),
m_SoundcardSlotChange(CARD_UNCHANGED), m_SoundcardSlotChange(CARD_UNCHANGED),
m_nCurrentIDCheckButton(0) m_nCurrentIDCheckButton(0)
@ -21,12 +22,12 @@ public:
static BOOL CALLBACK DlgProc(HWND window, UINT message, WPARAM wparam, LPARAM lparam); static BOOL CALLBACK DlgProc(HWND window, UINT message, WPARAM wparam, LPARAM lparam);
DWORD GetVolumeMax(void){ return VOLUME_MAX; } DWORD GetVolumeMax(void){ return VOLUME_MAX; }
bool NewSoundcardConfigured(HWND window, WPARAM wparam, LPCSTR pMsg, UINT& afterclose); bool NewSoundcardConfigured(HWND window, WPARAM wparam, LPCSTR pMsg);
protected: protected:
// IPropertySheetPage // IPropertySheetPage
virtual BOOL DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam); virtual BOOL DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam);
virtual void DlgOK(HWND window, UINT afterclose); virtual void DlgOK(HWND window);
virtual void DlgCANCEL(HWND window){} virtual void DlgCANCEL(HWND window){}
private: private:
@ -34,6 +35,7 @@ private:
const PAGETYPE m_Page; const PAGETYPE m_Page;
CPropertySheetHelper& m_PropertySheetHelper; CPropertySheetHelper& m_PropertySheetHelper;
UINT m_uAfterClose;
static const UINT VOLUME_MIN = 0; static const UINT VOLUME_MIN = 0;
static const UINT VOLUME_MAX = 59; static const UINT VOLUME_MAX = 59;

View File

@ -75,7 +75,6 @@ void CPropertySheet::Init(void)
PropSheetHeader.nStartPage = g_PropertySheetHelper.GetLastPage(); PropSheetHeader.nStartPage = g_PropertySheetHelper.GetLastPage();
PropSheetHeader.ppsp = PropSheetPages; PropSheetHeader.ppsp = PropSheetPages;
// g_bConfirmedRestartEmulator = false;
g_PropertySheetHelper.SetUIControlFreezeDlgButton(UI_UNDEFINED); g_PropertySheetHelper.SetUIControlFreezeDlgButton(UI_UNDEFINED);
g_PropertySheetHelper.SetUIControlCloneDropdownMenu(UI_UNDEFINED); g_PropertySheetHelper.SetUIControlCloneDropdownMenu(UI_UNDEFINED);
int i = PropertySheet(&PropSheetHeader); // Result: 0=Cancel, 1=OK int i = PropertySheet(&PropSheetHeader); // Result: 0=Cancel, 1=OK

View File

@ -199,3 +199,11 @@ int CPropertySheetHelper::SaveStateSelectImage(HWND hWindow, TCHAR* pszTitle, bo
m_bSSNewFilename = nRes ? true : false; m_bSSNewFilename = nRes ? true : false;
return nRes; return nRes;
} }
// On OK: Optionally post a single "uAfterClose" msg after last page closes
void CPropertySheetHelper::PostMsgAfterClose(PAGETYPE page, UINT uAfterClose)
{
m_bmPages &= ~(1<<(UINT32)page);
if (m_bmPages == 0 && uAfterClose)
PostMessage(g_hFrameWindow, uAfterClose, 0, 0);
}

View File

@ -6,6 +6,7 @@ class CPropertySheetHelper
public: public:
CPropertySheetHelper() : CPropertySheetHelper() :
m_LastPage(PG_CONFIG), m_LastPage(PG_CONFIG),
m_bmPages(0),
m_UIControlFreezeDlgButton(UI_UNDEFINED), m_UIControlFreezeDlgButton(UI_UNDEFINED),
m_UIControlCloneDropdownMenu(UI_UNDEFINED), m_UIControlCloneDropdownMenu(UI_UNDEFINED),
m_bSSNewFilename(false) m_bSSNewFilename(false)
@ -21,9 +22,15 @@ public:
void SaveStateUpdate(); void SaveStateUpdate();
void GetDiskBaseNameWithAWS(TCHAR* pszFilename); void GetDiskBaseNameWithAWS(TCHAR* pszFilename);
int SaveStateSelectImage(HWND hWindow, TCHAR* pszTitle, bool bSave); int SaveStateSelectImage(HWND hWindow, TCHAR* pszTitle, bool bSave);
void PostMsgAfterClose(PAGETYPE page, UINT uAfterClose);
PAGETYPE GetLastPage(void) { return m_LastPage; } PAGETYPE GetLastPage(void) { return m_LastPage; }
void SetLastPage(PAGETYPE page) { m_LastPage = page; } void SetLastPage(PAGETYPE page)
{
m_LastPage = page;
m_bmPages |= 1<<(UINT32)page;
}
UICONTROLSTATE GetUIControlFreezeDlgButton(void) { return m_UIControlFreezeDlgButton; } UICONTROLSTATE GetUIControlFreezeDlgButton(void) { return m_UIControlFreezeDlgButton; }
void SetUIControlFreezeDlgButton(UICONTROLSTATE state) { m_UIControlFreezeDlgButton = state; } void SetUIControlFreezeDlgButton(UICONTROLSTATE state) { m_UIControlFreezeDlgButton = state; }
UICONTROLSTATE GetUIControlCloneDropdownMenu(void) { return m_UIControlCloneDropdownMenu; } UICONTROLSTATE GetUIControlCloneDropdownMenu(void) { return m_UIControlCloneDropdownMenu; }
@ -33,6 +40,7 @@ public:
private: private:
PAGETYPE m_LastPage; PAGETYPE m_LastPage;
UINT32 m_bmPages;
UICONTROLSTATE m_UIControlFreezeDlgButton; UICONTROLSTATE m_UIControlFreezeDlgButton;
UICONTROLSTATE m_UIControlCloneDropdownMenu; UICONTROLSTATE m_UIControlCloneDropdownMenu;
char m_szNewFilename[MAX_PATH]; char m_szNewFilename[MAX_PATH];