Now ignores WM_COMMAND messages received while the dialog is in the process of being created.

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3388 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
eccles 2004-01-12 23:23:36 +00:00
parent b4a76d1585
commit 6429ab2452
2 changed files with 15 additions and 11 deletions

View file

@ -30,15 +30,16 @@
void *WINAPI MALLOC(int len) { return (void*)GlobalAlloc(GPTR,len); }
void WINAPI FREE(void *d) { if (d) GlobalFree((HGLOBAL)d); }
static int WINAPI popstring(char *str)
void WINAPI popstring(char *str)
{
stack_t *th;
if (!g_stacktop || !*g_stacktop) return 1;
th=(*g_stacktop);
if (str) lstrcpy(str,th->text);
*g_stacktop = th->next;
FREE(th);
return 0;
if (g_stacktop && *g_stacktop)
{
stack_t *th = *g_stacktop;
*g_stacktop = th->next;
if (str)
lstrcpy(str, th->text);
FREE(th);
}
}
#define strcpy(x,y) lstrcpy(x,y)
@ -558,7 +559,8 @@ LRESULT WINAPI WMCommandProc(HWND hWnd, UINT id, HWND hwndCtl, UINT codeNotify)
{
char szBrowsePath[MAX_PATH];
int nIdx = FindControlIdx(id);
if (nIdx < 0)
// Ignore if the dialog is in the process of being created
if (g_done || nIdx < 0)
break;
if (pFields[nIdx].nType == FIELD_BROWSEBUTTON)
--nIdx;
@ -870,6 +872,9 @@ int WINAPI createCfgDlg()
HFONT hFont = (HFONT)mySendMessage(mainwnd, WM_GETFONT, 0, 0);
// Prevent WM_COMMANDs from being processed while we are building
g_done = 1;
RECT dialog_r;
int mainWndWidth, mainWndHeight;
hConfigWindow=CreateDialog(m_hInstance,MAKEINTRESOURCE(IDD_DIALOG1),mainwnd,cfgDlgProc);
@ -1268,8 +1273,7 @@ void WINAPI showCfgDlg()
// quit soon, which means the ini might get flushed late and cause crap. :) anwyay.
if (!g_is_cancel) SaveSettings();
if (lpWndProcOld)
SetWindowLong(hMainWindow,DWL_DLGPROC,(long)lpWndProcOld);
SetWindowLong(hMainWindow,DWL_DLGPROC,(long)lpWndProcOld);
DestroyWindow(hConfigWindow);
// by ORTIM: 13-August-2002