X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwinboard.c;h=6c5d0eeab93d5c43af9a24d79920ee0cccaff1e8;hb=e833cd22af38d0042dd3e5e6ccf7914fb18cf767;hp=c7aebcf18b690c45e060e70833d3d1a2255f5422;hpb=18c97517acda747ffe9d9177c61c9bf5b1195bb6;p=xboard.git diff --git a/winboard/winboard.c b/winboard/winboard.c index c7aebcf..6c5d0ee 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -4703,7 +4703,6 @@ HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) GetDIBits(tmphdc,bufferBitmap,0,b.bmHeight,pData,(BITMAPINFO*)&bih,DIB_RGB_COLORS); // fprintf(diagFile, "%8x\n", (int) pData); -#if 1 wb = b.bmWidthBytes; // count colors for(i=0; i>2; i++) { @@ -4751,7 +4750,6 @@ HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) // write bitmap data for(i=0; imsg == WM_LBUTTONUP) { - TEXTRANGE tr; - - tr.chrg = pLink->chrg; - tr.lpstrText = malloc(1+tr.chrg.cpMax-tr.chrg.cpMin); - hText = GetDlgItem(hDlg, OPT_ConsoleText); - SendMessage(hText, EM_GETTEXTRANGE, 0, (LPARAM)&tr); - ShellExecute(NULL, "open", tr.lpstrText, NULL, NULL, SW_SHOW); - free(tr.lpstrText); + TEXTRANGE tr; + + tr.chrg = pLink->chrg; + tr.lpstrText = malloc(1+tr.chrg.cpMax-tr.chrg.cpMin); + SendMessage(hText, EM_GETTEXTRANGE, 0, (LPARAM)&tr); + ShellExecute(NULL, "open", tr.lpstrText, NULL, NULL, SW_SHOW); + free(tr.lpstrText); } } break; @@ -8157,7 +8155,7 @@ ConsoleWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) wp.rcNormalPosition.bottom = wpConsole.y + wpConsole.height; SetWindowPlacement(hDlg, &wp); } -#if 1 + // [HGM] Chessknight's change 2004-07-13 else { /* Determine Defaults */ WINDOWPLACEMENT wp; @@ -8176,7 +8174,12 @@ ConsoleWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) wp.rcNormalPosition.bottom = wpConsole.y + wpConsole.height; SetWindowPlacement(hDlg, &wp); } -#endif + + // Allow hText to highlight URLs and send notifications on them + wMask = SendMessage(hText, EM_GETEVENTMASK, 0, 0L); + SendMessage(hText, EM_SETEVENTMASK, 0, wMask | ENM_LINK); + SendMessage(hText, EM_AUTOURLDETECT, TRUE, 0L); + return FALSE; case WM_SETFOCUS: @@ -8246,18 +8249,10 @@ ConsoleWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) VOID ConsoleCreate() { - HWND hCons, hText; - WORD wMask; + HWND hCons; if (hwndConsole) return; hCons = CreateDialog(hInst, szConsoleName, 0, NULL); SendMessage(hCons, WM_INITDIALOG, 0, 0); - - - // make the text item in the console do URL links - hText = GetDlgItem(hCons, OPT_ConsoleText); - wMask = SendMessage(hText, EM_GETEVENTMASK, 0, 0L); - SendMessage(hText, EM_SETEVENTMASK, 0, wMask | ENM_LINK); - SendMessage(hText, EM_AUTOURLDETECT, TRUE, 0L); }