Temporary workaround to FindControlIdx returning -1

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2874 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-09-07 14:36:03 +00:00
parent 4fca1b55d8
commit 19556df888
2 changed files with 9 additions and 1 deletions

View file

@ -663,6 +663,8 @@ LRESULT WMCommandProc(HWND hWnd, UINT id, HWND hwndCtl, UINT codeNotify) {
case BN_CLICKED: case BN_CLICKED:
{ {
int nIdx = FindControlIdx(id); int nIdx = FindControlIdx(id);
if (nIdx < 0)
break;
if (pFields[nIdx].nType == FIELD_BROWSEBUTTON) { if (pFields[nIdx].nType == FIELD_BROWSEBUTTON) {
int nParentIdx = pFields[nIdx].nParentIdx; int nParentIdx = pFields[nIdx].nParentIdx;
switch(pFields[nParentIdx].nType) { switch(pFields[nParentIdx].nType) {
@ -726,7 +728,10 @@ BOOL CALLBACK cfgDlgProc(HWND hwndDlg,
HFONT OldFont; HFONT OldFont;
LOGFONT lf; LOGFONT lf;
#endif #endif
if (nIdx < 0)
break;
#ifdef IO_LINK_UNDERLINED #ifdef IO_LINK_UNDERLINED
GetObject(GetCurrentObject(lpdis->hDC, OBJ_FONT), sizeof(lf), &lf); GetObject(GetCurrentObject(lpdis->hDC, OBJ_FONT), sizeof(lf), &lf);
lf.lfUnderline = TRUE; lf.lfUnderline = TRUE;
@ -789,6 +794,9 @@ BOOL CALLBACK cfgDlgProc(HWND hwndDlg,
int WINAPI StaticLINKWindowProc(HWND hWin, UINT uMsg, LPARAM wParam, WPARAM lParam) int WINAPI StaticLINKWindowProc(HWND hWin, UINT uMsg, LPARAM wParam, WPARAM lParam)
{ {
int StaticField = FindControlIdx(GetDlgCtrlID(hWin)); int StaticField = FindControlIdx(GetDlgCtrlID(hWin));
if (StaticField < 0)
return 0;
switch(uMsg) switch(uMsg)
{ {
case WM_GETDLGCODE: case WM_GETDLGCODE:

Binary file not shown.