char buf[MSG_SIZ], mess[MSG_SIZ];\r
int partner = -1, i;\r
static BOOL filterHasFocus[MAX_CHAT];\r
+ WORD wMask;\r
+ HWND hMemo;\r
\r
for(i=0; i<MAX_CHAT; i++) if(hDlg == chatHandle[i]) { partner = i; break; }\r
\r
filterHasFocus[partner] = FALSE;\r
SetFocus( GetDlgItem(hDlg, OPT_ChatInput) );\r
}\r
+ hMemo = GetDlgItem(hDlg, IDC_ChatMemo);\r
+ wMask = (WORD) SendMessage(hMemo, EM_GETEVENTMASK, 0, 0L);\r
+ SendMessage(hMemo, EM_SETEVENTMASK, 0, wMask | ENM_LINK);\r
+ SendMessage(hMemo, EM_AUTOURLDETECT, TRUE, 0L);\r
return FALSE;\r
\r
+ case WM_NOTIFY:\r
+ if (((NMHDR*)lParam)->code == EN_LINK)\r
+ {\r
+ ENLINK *pLink = (ENLINK*)lParam;\r
+ if (pLink->msg == WM_LBUTTONUP)\r
+ {\r
+ TEXTRANGE tr;\r
+\r
+ tr.chrg = pLink->chrg;\r
+ tr.lpstrText = malloc(1+tr.chrg.cpMax-tr.chrg.cpMin);\r
+ SendMessage( GetDlgItem(hDlg, IDC_ChatMemo), EM_GETTEXTRANGE, 0, (LPARAM)&tr);\r
+ ShellExecute(NULL, "open", tr.lpstrText, NULL, NULL, SW_SHOW);\r
+ free(tr.lpstrText);\r
+ }\r
+ }\r
+ break;\r
+\r
case WM_COMMAND:\r
/* \r
[AS]\r
PUSHBUTTON "Clear",IDC_Clear,198,3,25,13\r
DEFPUSHBUTTON "Send",IDC_Send,228,3,25,13\r
CONTROL "",IDC_ChatMemo,"RICHEDIT",ES_MULTILINE | ES_READONLY |\r
- ES_AUTOVSCROLL | ES_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | \r
+ ES_AUTOVSCROLL | WS_BORDER | WS_VSCROLL | \r
WS_HSCROLL | WS_TABSTOP,3,17,250,70\r
CONTROL "",OPT_ChatInput,"RICHEDIT",ES_AUTOHSCROLL | ES_NOHIDESEL | \r
WS_BORDER | WS_TABSTOP,3,90,250,13\r