home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!plains!news.u.washington.edu!milton!bytor
- From: bytor@milton.u.washington.edu (Jill Patterson)
- Newsgroups: comp.os.ms-windows.programmer.misc
- Subject: Re: BC++ OWL TEdit Questions
- Message-ID: <bytor.714417962@milton>
- Date: 21 Aug 92 17:26:02 GMT
- Article-I.D.: milton.bytor.714417962
- References: <bytor.714343854@milton>
- Sender: news@u.washington.edu (USENET News System)
- Organization: University of Washington
- Lines: 71
-
- bytor@milton.u.washington.edu (Jill Patterson) writes:
-
- > /* Cleanup */
- > SelectObject(ps.hdc, hOldPen);
- > DeleteObject(hDkGrayPen);
- > DeleteObject(hBrFrame);
- > EndPaint(HWindow, &ps);
-
- I have added the following two lines and it seems to work OK!
-
- // Get The Rectangle Just Inside The Frame
- InflateRect(&rc, -1, -1);
-
- // Invalidate The Region
- InvalidateRegion(ps.hdc, &rc, TRUE);
- n
- >}
-
- I now have another question. How Do I get To change the foreground,
- and background colors of the edit control. I have tried trapping the
- WM_CTLCOLOR Message in the the TMainWindow::WMCtlColor function but it
- doesn't seem to be working. Here's My Code:
-
- /*
- ** TMainWnd::WMCtlColor()
- */
- DWORD TMainWnd::WMCtlColor(RTMessage Msg)
- {
- HDC hDC;
- WORD wChildType;
- WORD wChildId;
-
- wChildType = HIWORD(Msg.LParam);
- wChildId = GetWindowWord(LOWORD(Msg.LParam), GWW_ID);
-
- UnrealizeObject(hBrushRed);
- SetBrushOrg(LOWORD(Msg.LParam), 0, 0);
-
- switch(wChildType)
- {
- case CTLCOLOR_EDIT:
- switch(wChildId)
- {
- case 101:
- SetTextColor(Msg.WParam, RGB(255, 0, 0));
- return (DWORD)hBrushRed;
-
- default:
- SetTextColor(Msg.WParam, RGB(0, 0, 255));
- return (DWORD)hBrushRed;
- };
-
- default:
- SetTextColor(Msg.WParam, RGB(0, 255, 0));
- return (DWORD)hBrushRed;
- };
- }
-
- Does This Look Right, I use CreateSolidBrush in TMainWnd::Setup to create
- the hBrushRed, and I delete it at CloseWindow;
-
- I don't get any compile errors, is the prototype correct?
-
- DWORD TMainWnd::WMCtlColor(RTMessage Msg) = [WM_FIRST + WM_CTLCOLOR];
-
- I know its getting there because I had message boxes in telling me
- where I was, and I also looked at it with the debugger. Does anybody
- have any sample code using OWL for this?????
-
- THX
- bytor@milton.u.washington.edu
-