MINMAXINFO *mmi;\r
\r
switch (message) {\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
+ hText = GetDlgItem(hDlg, OPT_ConsoleText);\r
+ SendMessage(hText, EM_GETTEXTRANGE, 0, (LPARAM)&tr);\r
+ ShellExecute(NULL, "open", tr.lpstrText, NULL, NULL, SW_SHOW);\r
+ free(tr.lpstrText);\r
+ }\r
+ }\r
+ break;\r
case WM_INITDIALOG: /* message: initialize dialog box */\r
hwndConsole = hDlg;\r
hText = GetDlgItem(hDlg, OPT_ConsoleText);\r
VOID\r
ConsoleCreate()\r
{\r
- HWND hCons;\r
+ HWND hCons, hText;\r
+ WORD wMask;\r
if (hwndConsole) return;\r
hCons = CreateDialog(hInst, szConsoleName, 0, NULL);\r
SendMessage(hCons, WM_INITDIALOG, 0, 0);\r
+\r
+\r
+ // make the text item in the console do URL links\r
+ hText = GetDlgItem(hCons, OPT_ConsoleText);\r
+ wMask = SendMessage(hText, EM_GETEVENTMASK, 0, 0L);\r
+ SendMessage(hText, EM_SETEVENTMASK, 0, wMask | ENM_LINK);\r
+ SendMessage(hText, EM_AUTOURLDETECT, TRUE, 0L);\r
}\r
\r
\r