First verify fields and then, only if all are valid, call the leave function
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3262 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
45c040b909
commit
03acdc2211
2 changed files with 12 additions and 8 deletions
|
@ -673,20 +673,24 @@ BOOL CALLBACK ParentWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPara
|
||||||
BOOL bRes;
|
BOOL bRes;
|
||||||
if (message == WM_NOTIFY_OUTER_NEXT && wParam == 1)
|
if (message == WM_NOTIFY_OUTER_NEXT && wParam == 1)
|
||||||
{
|
{
|
||||||
|
// Don't call leave function if fields aren't valid
|
||||||
|
if (!ValidateFields())
|
||||||
|
return 0;
|
||||||
// Get the settings ready for the leave function verification
|
// Get the settings ready for the leave function verification
|
||||||
SaveSettings();
|
SaveSettings();
|
||||||
g_NotifyField = 0; // Reset the record of activated control
|
// Reset the record of activated control
|
||||||
|
g_NotifyField = 0;
|
||||||
}
|
}
|
||||||
bRes = CallWindowProc((long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long))lpWndProcOld,hwnd,message,wParam,lParam);
|
bRes = CallWindowProc((long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long))lpWndProcOld,hwnd,message,wParam,lParam);
|
||||||
if (message == WM_NOTIFY_OUTER_NEXT && !bRes)
|
if (message == WM_NOTIFY_OUTER_NEXT && !bRes)
|
||||||
{
|
{
|
||||||
// if leave function didn't abort (lRes != 0 in that case)
|
// if leave function didn't abort (bRes != 0 in that case)
|
||||||
if (wParam == NOTIFY_BYE_BYE || wParam == -1 || ValidateFields()) {
|
if (wParam == -1)
|
||||||
if (wParam == -1) g_is_back++;
|
g_is_back++;
|
||||||
if (wParam == NOTIFY_BYE_BYE) g_is_cancel++;
|
if (wParam == NOTIFY_BYE_BYE)
|
||||||
g_done++;
|
g_is_cancel++;
|
||||||
PostMessage(hConfigWindow,WM_CLOSE,0,0);
|
g_done++;
|
||||||
}
|
PostMessage(hConfigWindow,WM_CLOSE,0,0);
|
||||||
}
|
}
|
||||||
return bRes;
|
return bRes;
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue