From 68a95feae8066ab9fc1f8c2bbe5eecca57db12ac Mon Sep 17 00:00:00 2001 From: sunjammerx Date: Sat, 7 Sep 2002 21:33:48 +0000 Subject: [PATCH] Return key now works on licence page at the same time as the "give initial focus to licence text" patch :) git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@955 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/Ui.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index a17f29c5..3faad037 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -673,7 +673,7 @@ static BOOL CALLBACK LicenseProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM hwLicense=GetDlgItem(hwndDlg,IDC_EDIT1); SendMessage(hwLicense,EM_AUTOURLDETECT,TRUE,0); SendMessage(hwLicense,EM_SETBKGNDCOLOR,0,g_inst_header->license_bg>=0?g_inst_header->license_bg:GetSysColor(COLOR_BTNFACE)); - SendMessage(hwLicense,EM_SETEVENTMASK,0,ENM_LINK); + SendMessage(hwLicense,EM_SETEVENTMASK,0,ENM_LINK|ENM_KEYEVENTS); dwRead=0; SendMessage(hwLicense,EM_STREAMIN,(((char*)es.dwCookie)[0]=='{')?SF_RTF:SF_TEXT,(LPARAM)&es); SetUITextFromLang(hwndDlg,IDC_INTROTEXT,g_inst_header->common.intro_text_id,LANGID_LICENSE_TEXT); @@ -704,6 +704,20 @@ static BOOL CALLBACK LicenseProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM SetCursor(LoadCursor(0,IDC_HAND)); } } + // nmhdr.code==EN_MSGFILTER but I noticed that the 3e8 value I *was* + // getting contains the bits set by EN_MSGFILTER so I figured I'd set + // this to & EN_MSGFILTER and pray :) Since it only works when return + // is pressed *and* in that case both these tests pass I figure that + // must be correct... wish it was documented somewhere gawd damnit! + else if (((MSGFILTER*)lParam)->nmhdr.code&EN_MSGFILTER) + { + if (((MSGFILTER*)lParam)->msg==WM_KEYDOWN && + ((MSGFILTER*)lParam)->wParam==VK_RETURN) + { + SendMessage(g_hwnd,WM_NOTIFY_OUTER_NEXT,1,0); + return 1; + } + } } else if (uMsg == WM_CLOSE) { SendMessage(g_hwnd,WM_CLOSE,0,0);