static int sizeX, sizeY;\r
int newSizeX, newSizeY;\r
MINMAXINFO *mmi;\r
+ WORD wMask;\r
\r
switch (message) {\r
case WM_NOTIFY:\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
+ TEXTRANGE tr;\r
+\r
+ tr.chrg = pLink->chrg;\r
+ tr.lpstrText = malloc(1+tr.chrg.cpMax-tr.chrg.cpMin);\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
SetWindowPlacement(hDlg, &wp);\r
}\r
\r
+ // Allow hText to highlight URLs and send notifications on them\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
return FALSE;\r
\r
case WM_SETFOCUS:\r
VOID\r
ConsoleCreate()\r
{\r
- HWND hCons, hText;\r
- WORD wMask;\r
+ HWND hCons;\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