Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

640 lines
19 KiB

  1. /*===========================================================================*/
  2. /* Copyright (c) 1987 - 1988, Future Soft Engineering, Inc. */
  3. /* Houston, Texas */
  4. /*===========================================================================*/
  5. #define NOLSTRING TRUE /* jtf win3 mod */
  6. #include <windows.h>
  7. #include "port1632.h"
  8. #include "dcrc.h"
  9. #include "dynacomm.h"
  10. #include "task.h"
  11. #include "video.h"
  12. #include "printfil.h"
  13. extern BOOL bZoomFlag; /* itutil2.c - zoomTerm() [mbb] */
  14. VOID NEAR PASCAL FreeList(HANDLE *hList)
  15. {
  16. GlobalUnlock(*hList);
  17. GlobalFree(*hList);
  18. }
  19. /*---------------------------------------------------------------------------*/
  20. /* DC_WndProc() [mbb] */
  21. /*---------------------------------------------------------------------------*/
  22. HWND dlgGetFocus() /* mbbx 2.01.85 ... */
  23. {
  24. HWND hWnd;
  25. if(((hWnd = GetActiveWindow()) == NULL) || !IsChild(hItWnd, hWnd)) /* mbbx 2.01.179 (2.01.150) ... */
  26. hWnd = hItWnd;
  27. hWnd = GetActiveWindow(); /* jtf gold 044 */
  28. if (hWnd == NULL) testMsg("BAD WINDOW",NULL,NULL);
  29. return(hWnd);
  30. }
  31. VOID selectTopWindow() /* mbbx 1.03 ... */
  32. {
  33. HWND hTopWnd;
  34. if(((hTopWnd = GetTopWindow(hItWnd)) == NULL) || (hTopWnd == hdbmyControls))
  35. hTopWnd = hItWnd;
  36. if (hTopWnd != NULL) /* jtfterm */
  37. SetFocus(hTopWnd);
  38. }
  39. LRESULT APIENTRY DC_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
  40. {
  41. LRESULT DC_WndProc = 0L;
  42. // sdj: was unref local - HWND hTopWnd;
  43. PAINTSTRUCT ps;
  44. BYTE work[STR255]; /* jtf 3.15 */
  45. // sdj: was unref local - RECT clipRect;
  46. // sdj: was unref local - HDC tempDC;
  47. INT testFlag; /* jtf 3.23 */
  48. RECT hItWndRectToSave; // sdj: added this to save wndsize
  49. char tmpstr[10];
  50. BYTE str[MINRESSTR];
  51. DEBOUT("DC_WndProc: msg[%lx] GOT IT\n",message);
  52. switch(message)
  53. {
  54. case WM_WININICHANGE: /* jtf 3.21 */
  55. setDefaultAttrib(TRUE);
  56. InvalidateRect(hTermWnd, NULL, TRUE);
  57. InvalidateRect(hdbmyControls, NULL, TRUE);
  58. UpdateWindow(hTermWnd);
  59. UpdateWindow(hdbmyControls);
  60. break;
  61. /* changed all wParam == hSomething to wParam == (WPARAM) hSomething -sdj*/
  62. case WM_SETCURSOR: /* jtf 3.20 allow hour glass to stay hour */
  63. if (scrapSeq && (wParam == (WPARAM)hTermWnd) && (LOWORD(lParam) == HTCLIENT) ) /* jtf 3.30 */
  64. {
  65. SetCursor(LoadCursor(NULL, IDC_WAIT));
  66. return (TRUE);
  67. }
  68. if ( ( wParam == (WPARAM)GetDlgItem(hdbmyControls, IDMORE) ) ||
  69. ( wParam == (WPARAM)GetDlgItem(hdbmyControls, IDTIMER) ) ||
  70. ( wParam == (WPARAM)GetDlgItem(hdbmyControls, IDFK1) ) ||
  71. ( wParam == (WPARAM)GetDlgItem(hdbmyControls, IDFK2) ) ||
  72. ( wParam == (WPARAM)GetDlgItem(hdbmyControls, IDFK3) ) ||
  73. ( wParam == (WPARAM)GetDlgItem(hdbmyControls, IDFK4) ) ||
  74. ( wParam == (WPARAM)GetDlgItem(hdbmyControls, IDFK5) ) ||
  75. ( wParam == (WPARAM)GetDlgItem(hdbmyControls, IDFK6) ) ||
  76. ( wParam == (WPARAM)GetDlgItem(hdbmyControls, IDFK7) ) ||
  77. ( wParam == (WPARAM)GetDlgItem(hdbmyControls, IDFK8) ) )
  78. {
  79. SetCursor(LoadCursor(hInst, (LPSTR) "hand"));
  80. return(TRUE);
  81. }
  82. DC_WndProc = DefWindowProc(hWnd, message, wParam, lParam);
  83. break;
  84. case WM_SIZE:
  85. if(wParam != SIZEICONIC)
  86. DC_WndProc = DefWindowProc(hWnd, message, wParam, lParam);
  87. if ((wParam != SIZEICONIC) && (hdbmyControls != NULL) && (!IsIconic(hItWnd)) )/* rjs bugs 015 -> add wParam == SIZEICONIC */
  88. {
  89. sizeFkeys(lParam);
  90. if ((hTermWnd != NULL) && (!IsIconic(hItWnd)) )
  91. sizeTerm(0L);
  92. if(IsWindowVisible(hdbmyControls))
  93. UpdateWindow(hdbmyControls);
  94. }
  95. break;
  96. case WM_SETFOCUS:
  97. case WM_KILLFOCUS: /* rjs bugs 011 */
  98. if (hTermWnd != NULL) /* jtf 3.30 */
  99. UpdateWindow(hTermWnd); /* jtf 3.30 */
  100. //sdj: the status line does not get updates when you come back
  101. //sdj: to terminal focus.
  102. if (hdbmyControls != NULL)
  103. {
  104. if(IsWindowVisible(hdbmyControls))
  105. {
  106. InvalidateRect(hdbmyControls, NULL, FALSE);
  107. UpdateWindow(hdbmyControls);
  108. }
  109. }
  110. if(message == WM_SETFOCUS) /* rjs bugs 011 */
  111. {
  112. showTermCursor(); /* rjs bugs 011 */
  113. selectTopWindow(); /* mbbx 1.03 */
  114. }
  115. else /* rjs bugs 011 */
  116. hideTermCursor(); /* rjs bugs 011 */
  117. break;
  118. /* jtfterm case WM_ERASEBKGND:
  119. GetClipBox((HDC) wParam, (LPRECT) &clipRect);
  120. eraseColorRect((HDC) wParam, (LPRECT) &clipRect, ANORMAL);
  121. DC_WndProc = 1L;
  122. break; */
  123. case WM_ERASEBKGND: /* jtf 3.17 */
  124. if(IsIconic(hWnd))
  125. return DefWindowProc(hWnd,WM_ICONERASEBKGND,wParam,lParam);
  126. else
  127. {
  128. DC_WndProc = DefWindowProc(hWnd, message, wParam, lParam);
  129. break;
  130. }
  131. case WM_QUERYDRAGICON: /* jtf 3.17 */
  132. return (LRESULT)icon.hIcon;
  133. case WM_PAINT:
  134. if(IsIconic(hWnd))
  135. {
  136. BeginPaint(hWnd, (LPPAINTSTRUCT) &ps);
  137. myDrawIcon(ps.hdc, !ps.fErase);
  138. EndPaint(hWnd, (LPPAINTSTRUCT) &ps);
  139. break;
  140. }
  141. DC_WndProc = DefWindowProc(hWnd, message, wParam, lParam);
  142. break;
  143. case WM_CLOSE:
  144. case WM_QUERYENDSESSION:
  145. testFlag = 0;
  146. /* Added 02/22/91 for win 3.1 common print dialog w-dougw */
  147. if(hDevNames)
  148. FreeList(&hDevNames);
  149. if(hDevMode)
  150. FreeList(&hDevMode);
  151. if (mdmOnLine)
  152. {
  153. LoadString(hInst, STRERRHANGUP, (LPSTR) work, STR255-1); /* jtf 3.15 */
  154. testFlag = MessageBox(GetActiveWindow(), (LPSTR) work, (LPSTR) szAppName, MB_YESNOCANCEL);
  155. }
  156. if (testFlag==IDCANCEL)
  157. break;
  158. if (testFlag==IDYES)
  159. hangUpPhone();
  160. WinHelp(hTermWnd,(LPSTR) work, (WORD) HELP_QUIT,0L);
  161. if (prtFlag)
  162. PrintFileComm(!prtFlag); /* jtf 3.15 */
  163. //sdj: lets get the current window x,y,width,height and save it into
  164. //sdj: the registry so that next time we load the settings user wants
  165. //sdj: only save the values into registry if the api succeeds
  166. if(GetWindowRect(hWnd,&hItWndRectToSave))
  167. {
  168. WindowXPosition = (int)hItWndRectToSave.left;
  169. WindowYPosition = (int)hItWndRectToSave.top;
  170. WindowWidth = ((int)hItWndRectToSave.right - WindowXPosition);
  171. WindowHeight = ((int)hItWndRectToSave.bottom - WindowYPosition);
  172. sprintf(tmpstr,"%d",WindowXPosition);
  173. LoadString(hInst, STR_INI_XPOSITION, (LPSTR) str, MINRESSTR);
  174. WriteProfileString((LPSTR) szAppName_private, (LPSTR) str, (LPSTR) tmpstr);
  175. sprintf(tmpstr,"%d",WindowYPosition);
  176. LoadString(hInst, STR_INI_YPOSITION, (LPSTR) str, MINRESSTR);
  177. WriteProfileString((LPSTR) szAppName_private, (LPSTR) str, (LPSTR) tmpstr);
  178. sprintf(tmpstr,"%d",WindowWidth);
  179. LoadString(hInst, STR_INI_WIDTH, (LPSTR) str, MINRESSTR);
  180. WriteProfileString((LPSTR) szAppName_private, (LPSTR) str, (LPSTR) tmpstr);
  181. sprintf(tmpstr,"%d",WindowHeight);
  182. LoadString(hInst, STR_INI_HEIGHT, (LPSTR) str, MINRESSTR);
  183. WriteProfileString((LPSTR) szAppName_private, (LPSTR) str, (LPSTR) tmpstr);
  184. }
  185. if(doneFlag = termCloseAll()) /* mbbx 1.01... */
  186. {
  187. return(TRUE); /* jtf 3.33 */
  188. /* DC_WndProc = DefWindowProc(hWnd, message, wParam, lParam); jtf 3.33, 3.28 and 3.26 */
  189. }
  190. break;
  191. case WM_QUERYOPEN:
  192. flashIcon(FALSE, FALSE);
  193. DC_WndProc = 1L;
  194. break;
  195. case WM_ENDSESSION:
  196. doneFlag = wParam;
  197. break;
  198. case WM_NCLBUTTONDBLCLK:
  199. if((wParam == HTCAPTION) && childZoomStatus(0x0001, 0))
  200. {
  201. ShowWindow(GetTopWindow(hItWnd), SW_RESTORE);
  202. break;
  203. }
  204. DC_WndProc = DefWindowProc(hWnd, message, wParam, lParam);
  205. break;
  206. case WM_KEYDOWN: /* mbbx 1.04: keymap ... */
  207. case WM_KEYUP:
  208. case WM_SYSKEYDOWN:
  209. case WM_SYSKEYUP:
  210. if (wParam == VK_F10) /* jtf 3.21 */
  211. {
  212. DC_WndProc = DefWindowProc(hWnd, message, wParam, lParam);
  213. break;
  214. }
  215. termKeyProc(hWnd, message, wParam, lParam);
  216. break;
  217. case WM_COMMAND:
  218. doCommand(hWnd, wParam, lParam);
  219. break;
  220. case WM_INITMENUPOPUP:
  221. initMenuPopup(LOWORD(lParam));
  222. break;
  223. default:
  224. DC_WndProc = DefWindowProc(hWnd, message, wParam, lParam);
  225. // idleProcess(); -sdj CAUSES RECURSION AND GDI/USER DEATH
  226. break;
  227. }
  228. DEBOUT("DC_WndProc: msg[%lx] PRCESSED\n",message);
  229. return(DC_WndProc);
  230. }
  231. /*---------------------------------------------------------------------------*/
  232. /* TF_WndProc() [mbb] */
  233. /*---------------------------------------------------------------------------*/
  234. VOID termKeyProc(HWND hWnd, UINT message, WPARAM wParam,LPARAM lParam) /* mbbx 1.04: keymap ... */
  235. {
  236. STRING termStr[STR255];
  237. POINT point; /* porting macro change (JAP) */
  238. if(keyMapTranslate(&wParam, &lParam, termStr))
  239. {
  240. if(!(lParam & (1L << 31)))
  241. fKeyStrBuffer(termStr+1, *termStr); /* termStr -> fKeyStr */
  242. return;
  243. }
  244. if(keyMapSysKey(hWnd, message, &wParam, lParam)) // sdj: AltGr
  245. return;
  246. if((hWnd == hTermWnd) && !(lParam & (1L << 31)))
  247. {
  248. switch(classifyKey((UINT)wParam))
  249. {
  250. case LONGBREAK:
  251. modemSendBreak(30);
  252. break;
  253. case SHORTBREAK:
  254. modemSendBreak(2);
  255. break;
  256. case TERMINALFKEY:
  257. if(keyPadSequence() && (*keyPadString > 0)) /* mbbx 1.04 ... */
  258. fKeyStrBuffer(keyPadString+1, *keyPadString); /* keyPadString -> fKeyStr */
  259. else
  260. sysBeep();
  261. break;
  262. case SCROLLKEY:
  263. switch(wParam)
  264. {
  265. case VK_HOME:
  266. case VK_END:
  267. /* rjs bugs 009 - add if statement from vk_prior case */
  268. if(keyMapState & VKS_CTRL)
  269. {
  270. nScrollPos.y = ((wParam == VK_HOME) ? 0 : nScrollRange.y);
  271. updateTermScrollBars(TRUE);
  272. }
  273. else
  274. {
  275. nScrollPos.x = ((wParam == VK_HOME) ? 0 : nScrollRange.x);
  276. updateTermScrollBars(TRUE);
  277. }
  278. break;
  279. case VK_PRIOR:
  280. case VK_NEXT:
  281. pageScroll((wParam == VK_PRIOR) ? SB_PAGEUP : SB_PAGEDOWN);
  282. break;
  283. case VK_UP:
  284. case VK_DOWN:
  285. case VK_RIGHT:
  286. case VK_LEFT:
  287. offCursor();
  288. longToPoint(hTE.selStart, &point);
  289. termClick(point, (keyMapState & VKS_SHIFT) ? TRUE : FALSE, wParam);
  290. onCursor();
  291. activSelect = TRUE;
  292. noSelect = FALSE; /* rjs bugs 020 */
  293. break;
  294. }
  295. break;
  296. default:
  297. switch(wParam)
  298. {
  299. case VK_INSERT:
  300. switch(keyMapState & (VKS_SHIFT | VKS_CTRL))
  301. {
  302. case VKS_SHIFT:
  303. if (!scrapSeq && ((xferFlag == XFRNONE) || (xferFlag == XFRRCV)) ) /* jtf 3.17 disable send if in transfer */
  304. doEditMenu(EMPASTE);
  305. break;
  306. case VKS_CTRL:
  307. if (!scrapSeq && ((xferFlag == XFRNONE) || (xferFlag == XFRRCV)) ) /* jtf 3.Final disable copy if in transfer */
  308. doEditMenu(EMCOPY);
  309. break;
  310. case VKS_SHIFT | VKS_CTRL:
  311. if (!scrapSeq && ((xferFlag == XFRNONE) || (xferFlag == XFRRCV)) ) /* jtf 3.17 disable send if in transfer */
  312. doEditMenu(EMCOPYTHENPASTE);
  313. break;
  314. }
  315. break;
  316. case VK_BACK:
  317. if(keyMapState & VKS_CTRL) /* rjs bugs 014 */
  318. {
  319. fKeyStrBuffer("\177", 1); /* rjs bugs 014 */
  320. }
  321. else /* rjs bugs 014 */
  322. {
  323. wParam = VK_DELETE;
  324. fKeyStrBuffer("\010\040\010", 3); /* jtf 3.33 */
  325. }
  326. break;
  327. case 'C':
  328. case 'c':
  329. if(!trmParams.useWinCtrl)
  330. break;
  331. switch(keyMapState & (VKS_SHIFT | VKS_CTRL | VKS_ALT))
  332. {
  333. case VKS_CTRL:
  334. if (!scrapSeq && ((xferFlag == XFRNONE) || (xferFlag == XFRRCV)) ) /* jtf 3.Final disable copy if in transfer */
  335. doEditMenu(EMCOPY);
  336. return;
  337. default:
  338. break;
  339. }
  340. break;
  341. case 'V':
  342. case 'v':
  343. if(!trmParams.useWinCtrl)
  344. break;
  345. switch(keyMapState & (VKS_SHIFT | VKS_CTRL | VKS_ALT))
  346. {
  347. case VKS_CTRL:
  348. if (!scrapSeq && ((xferFlag == XFRNONE) || (xferFlag == XFRRCV)) ) /* jtf 3.Final disable copy if in transfer */
  349. doEditMenu(EMPASTE);
  350. return;
  351. default:
  352. break;
  353. }
  354. break;
  355. }
  356. keyMapKeyProc(hWnd, message, wParam, lParam); // sdj: AltGr
  357. break;
  358. }
  359. }
  360. }
  361. /* mbbx 1.04: split DC & TF... */
  362. LRESULT APIENTRY TF_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
  363. {
  364. LRESULT TF_WndProc = 0L;
  365. INT tmpPortLocks;
  366. HDC tmpThePort;
  367. PAINTSTRUCT ps;
  368. RECT clipRect; /* mbbx 1.04: erase bkgd */
  369. POINT point;
  370. DEBOUT("TF_WndProc: msg[%lx] GOT IT\n",message);
  371. switch(message)
  372. {
  373. case WM_SIZE:
  374. break;
  375. case WM_SETFOCUS:
  376. case WM_KILLFOCUS:
  377. if (hTermWnd != NULL) /* jtf 3.30 */
  378. UpdateWindow(hTermWnd); /* jtf 3.30 */
  379. if(message == WM_SETFOCUS)
  380. {
  381. BringWindowToTop(hWnd);
  382. if(childZoomStatus(0x4001, 0) && !IsZoomed(hWnd))
  383. ShowWindow(hWnd, SW_MAXIMIZE);
  384. showTermCursor(); /* rjs bugs 011 */
  385. }
  386. else
  387. {
  388. if(childZoomStatus(0x8000, 0) && IsZoomed(hWnd))
  389. ShowWindow(hWnd, SW_RESTORE);
  390. hideTermCursor(); /* rjs bugs 011 */
  391. }
  392. FlashWindow(hWnd, TRUE);
  393. TF_WndProc = DefWindowProc(hWnd, message, wParam, lParam);
  394. break;
  395. case WM_PAINT:
  396. offCursor();
  397. tmpThePort = thePort;
  398. tmpPortLocks = portLocks;
  399. BeginPaint(hWnd, (LPPAINTSTRUCT) &ps);
  400. thePort = ps.hdc;
  401. if (xferFlag <= XFRNONE)
  402. FrameRect(thePort, (LPRECT) &statusRect, blackBrush); // This works, used to be after reDrawTermLine
  403. portLocks = 1;
  404. hTE.active = FALSE;
  405. SelectObject(thePort, hTE.hFont);
  406. /* rjs swat - was below next if block */
  407. termDeactivate(&hTE); /* rjs swat - added this line */
  408. reDrawTermScreen(0, visScreenLine+1, curTopLine - savTopLine); /* jtf 3.20 this was up one line this should repaint faster */
  409. termActivate(&hTE);
  410. if(xferFlag > XFRNONE) /* mbbx 1.04: fkeys... */
  411. updateIndicators();
  412. else
  413. reDrawTermLine(maxScreenLine+1, 0, maxChars);
  414. EndPaint(hWnd, (LPPAINTSTRUCT) &ps);
  415. portLocks = tmpPortLocks;
  416. thePort = tmpThePort;
  417. onCursor();
  418. break;
  419. case WM_ERASEBKGND: /* mbbx 1.04: fkeys... */
  420. GetClipBox((HDC) wParam, (LPRECT) &clipRect);
  421. eraseColorRect((HDC) wParam, (LPRECT) &clipRect, ANORMAL);
  422. TF_WndProc = 1L;
  423. break;
  424. case WM_NCLBUTTONDOWN:
  425. BringWindowToTop(hWnd);
  426. SetFocus(hWnd);
  427. TF_WndProc = DefWindowProc(hWnd, message, wParam, lParam);
  428. break;
  429. case WM_KEYDOWN: /* mbbx 1.04: keymap ... */
  430. case WM_KEYUP:
  431. case WM_SYSKEYDOWN:
  432. case WM_SYSKEYUP:
  433. if (wParam==VK_F10) /* jtf 3.21 */
  434. {
  435. TF_WndProc = DefWindowProc(hWnd, message, wParam, lParam);
  436. break;
  437. }
  438. termKeyProc(hWnd, message, wParam, lParam);
  439. break;
  440. case WM_CHAR: /* mbbx 1.04: keymap... */
  441. if((xferFlag == XFRNONE) || (xferFlag == XFRRCV) || xferPaused)
  442. if(!fKeyStrBuffer((BYTE *) &wParam, 1))
  443. sysBeep();
  444. /* rjs bugs 017 -> this entire if statement */
  445. if(nScrollPos.y != nScrollRange.y)
  446. if(maxScreenLine < visScreenLine)
  447. {
  448. nScrollPos.y = nScrollRange.y;
  449. updateTermScrollBars(TRUE);
  450. }
  451. else
  452. if((maxScreenLine - visScreenLine) < curLin)
  453. {
  454. nScrollPos.y = nScrollRange.y;
  455. updateTermScrollBars(TRUE);
  456. }
  457. /* rjs bugs 017 -> the end of the fix */
  458. break;
  459. case WM_SETCURSOR: /* block resize box make it arrow jtfterm */
  460. if ( (LOWORD(lParam) == HTBOTTOMRIGHT) ||
  461. (LOWORD(lParam) == HTBOTTOM) )
  462. lParam = MAKELONG( HTNOWHERE, HIWORD(lParam) );
  463. TF_WndProc = DefWindowProc(hWnd, message, wParam, lParam);
  464. break;
  465. case WM_SYSCOMMAND:
  466. switch(wParam & 0xFFF0)
  467. {
  468. case SC_SIZE: /* block resize box jtfterm */
  469. break;
  470. case SC_CLOSE:
  471. termCloseFile();
  472. break;
  473. default:
  474. TF_WndProc = DefWindowProc(hWnd, message, wParam, lParam);
  475. break;
  476. }
  477. break;
  478. case WM_HSCROLL:
  479. switch(GET_WM_HSCROLL_CODE(wParam, lParam))
  480. {
  481. case SB_LINEUP:
  482. scrollUp(SB_HORZ, GET_WM_HSCROLL_CODE(wParam, lParam), 1);
  483. break;
  484. case SB_LINEDOWN:
  485. scrollDown(SB_HORZ, GET_WM_HSCROLL_CODE(wParam, lParam), 1);
  486. break;
  487. case SB_PAGEUP:
  488. case SB_PAGEDOWN:
  489. #ifdef ORGCODE
  490. hpageScroll(GET_WM_HSCROLL_CODE(wParam, lParam));
  491. #else
  492. /* it is coded a hPageScroll in scroll.c, no such routine as hpageScroll-sdj*/
  493. hPageScroll(GET_WM_HSCROLL_CODE(wParam, lParam));
  494. #endif
  495. break;
  496. case SB_THUMBPOSITION:
  497. nScrollPos.x = GET_WM_HSCROLL_POS(wParam, lParam);
  498. updateTermScrollBars(TRUE);
  499. break;
  500. }
  501. break;
  502. case WM_VSCROLL:
  503. switch(GET_WM_VSCROLL_CODE(wParam, lParam))
  504. {
  505. case SB_LINEUP:
  506. scrollUp(SB_VERT, GET_WM_VSCROLL_CODE(wParam, lParam), 1);
  507. break;
  508. case SB_LINEDOWN:
  509. scrollDown(SB_VERT, GET_WM_VSCROLL_CODE(wParam, lParam), 1);
  510. break;
  511. case SB_PAGEUP:
  512. case SB_PAGEDOWN:
  513. pageScroll(GET_WM_VSCROLL_CODE(wParam, lParam));
  514. break;
  515. case SB_THUMBPOSITION:
  516. nScrollPos.y = GET_WM_VSCROLL_POS(wParam, lParam);
  517. updateTermScrollBars(TRUE);
  518. break;
  519. }
  520. break;
  521. case WM_LBUTTONDOWN:
  522. if(GetFocus() != hWnd) /* mbbx 1.04 ... */
  523. {
  524. BringWindowToTop(hWnd);
  525. SetFocus(hWnd);
  526. break;
  527. }
  528. offCursor();
  529. // termClick(MAKEMPOINT(lParam), (wParam & MK_SHIFT), FALSE);
  530. point.x = (LONG)LOWORD(lParam);
  531. point.y = (LONG)HIWORD(lParam);
  532. termClick(point, (wParam & MK_SHIFT), FALSE);
  533. onCursor();
  534. activSelect = TRUE;
  535. noSelect = FALSE; /* rjs bugs 020 */
  536. break;
  537. default:
  538. TF_WndProc = DefWindowProc(hWnd, message, wParam, lParam);
  539. // idleProcess(); -sdj CAUSES RECURSION AND GDI/USER DEATH
  540. break;
  541. }
  542. DEBOUT("TF_WndProc: msg[%lx] PRCESSED\n",message);
  543. return(TF_WndProc);
  544. }