Thread: Edit Box

  1. #1
    the Great ElastoManiac's Avatar
    Join Date
    Nov 2005
    Location
    Republika Srpska - Balkan
    Posts
    377

    Edit Box

    I want to make Multiline Edit Control, with a transparent background.
    ( Only Text And scrollbar should be visible ), how can i do this?
    lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu

  2. #2
    the Great ElastoManiac's Avatar
    Join Date
    Nov 2005
    Location
    Republika Srpska - Balkan
    Posts
    377
    If i could change the background of my edit control, i could sucssed.
    So that is a good solution too. How todo that?
    lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu

  3. #3
    the Great ElastoManiac's Avatar
    Join Date
    Nov 2005
    Location
    Republika Srpska - Balkan
    Posts
    377
    I mean to change the background to a HBITMAP.
    lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu

  4. #4
    VA National Guard The Brain's Avatar
    Join Date
    May 2004
    Location
    Manassas, VA USA
    Posts
    903
    I remember this tutorial on windows skinning address topics in transperancy.. although I am not sure if the same methods would apply to a multiline edit box...

    tried googling for an owner-draw edit box.. no love
    Last edited by The Brain; 12-14-2005 at 05:40 PM.
    • "Problem Solving C++, The Object of Programming" -Walter Savitch
    • "Data Structures and Other Objects using C++" -Walter Savitch
    • "Assembly Language for Intel-Based Computers" -Kip Irvine
    • "Programming Windows, 5th edition" -Charles Petzold
    • "Visual C++ MFC Programming by Example" -John E. Swanke
    • "Network Programming Windows" -Jones/Ohlund
    • "Sams Teach Yourself Game Programming in 24 Hours" -Michael Morrison
    • "Mathmatics for 3D Game Programming & Computer Graphics" -Eric Lengyel

  5. #5
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>make Multiline Edit Control<<

    Create the control with the ES_MULTILINE style.

    >>change the background to a HBITMAP<<

    Use CreatePatternBrush (very limited capability on win95, okay for later versions of windows) to convert the bitmap into a brush and return its handle from WM_CTLCOLOREDIT handler of the parent window (or WM_CTLCOLORSTATIC if the edit control is read only).

    Edit controls.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  6. #6
    the Great ElastoManiac's Avatar
    Join Date
    Nov 2005
    Location
    Republika Srpska - Balkan
    Posts
    377
    Thanks. It seems that i have to do the same thing for RichEdit. Sorry.
    And my RichEdit has a VSROLLbar.
    lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu

  7. #7
    the Great ElastoManiac's Avatar
    Join Date
    Nov 2005
    Location
    Republika Srpska - Balkan
    Posts
    377
    Since RichEdit doesn't have a WM_CTLCOLORXXX, i don't know what to do...
    lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu

  8. #8
    the Great ElastoManiac's Avatar
    Join Date
    Nov 2005
    Location
    Republika Srpska - Balkan
    Posts
    377
    There is a function to set a color of a Rich Edit Box (COLORREF), but there is nothing which includes HBRUSH...
    lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu

  9. #9
    Registered User
    Join Date
    Mar 2005
    Location
    Juneda
    Posts
    291
    with richedits you can send the EM_SETBKGNDCOLOR message, with
    Code:
    wParam = (WPARAM) (BOOL) fUseSysColor; 
    lParam = (LPARAM) (COLORREF) clr;
    set the wparam to 0 and set the lparam to a 0x00bbggrr value, or also works setting it to a (COLORRREF)RGB(r,g,b) return.
    Niara

  10. #10
    the Great ElastoManiac's Avatar
    Join Date
    Nov 2005
    Location
    Republika Srpska - Balkan
    Posts
    377
    Quote Originally Posted by Niara
    with richedits you can send the EM_SETBKGNDCOLOR message, with
    Code:
    wParam = (WPARAM) (BOOL) fUseSysColor; 
    lParam = (LPARAM) (COLORREF) clr;
    set the wparam to 0 and set the lparam to a 0x00bbggrr value, or also works setting it to a (COLORRREF)RGB(r,g,b) return.
    Niara
    You have no idea what your talking about.
    I want to talk to Ken Fitlike.
    lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu

  11. #11
    the Great ElastoManiac's Avatar
    Join Date
    Nov 2005
    Location
    Republika Srpska - Balkan
    Posts
    377
    There isn't even OWNERDRAWN style. There must be solution to this. I tryed to use Edit Control,
    ( its Read Only )
    but when i scroll down a little bit. The background image freaks out...
    lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu

  12. #12
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    One possibility might be to subclass the richedit control, and BitBlt your bitmap during handling of WM_ERASEBKGND for that control. Another, possibility is to superclass the richedit control and change the HBRUSH of the WNDCLASSEX to that returned by CreatePatternBrush.

    Not sure if either of these will work, though.

    For more information about window sublassing, search this board and read this.

    For superclassing, see the bottom of this msdn page (also contains more information on subclassing).

    >>You have no idea what your talking about.<<

    (s)he's factually correct and, while it's not exactly what you're looking for, you'll get more and varied help if you exhibit more grace and less impatience towards those generous enough to offer free advice.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  13. #13
    the Great ElastoManiac's Avatar
    Join Date
    Nov 2005
    Location
    Republika Srpska - Balkan
    Posts
    377
    Quote Originally Posted by Ken Fitlike
    >>You have no idea what your talking about.<<

    (s)he's factually correct and, while it's not exactly what you're looking for, you'll get more and varied help if you exhibit more grace and less impatience towards those generous enough to offer free advice.
    I know, i know. Just that (s)he started to explain what i allready wrote.
    lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu

  14. #14
    Registered User
    Join Date
    Mar 2005
    Location
    Juneda
    Posts
    291
    no problem
    void rename (open char* ">>(s)he's factually<<", concrete char* ">>he's...<<")
    Niara

  15. #15
    the Great ElastoManiac's Avatar
    Join Date
    Nov 2005
    Location
    Republika Srpska - Balkan
    Posts
    377
    I'm close to solution with subclassing. Iv'e tryed both paths, and subclassing seems to work.
    I did what you told me, and background is drawn. But the problem is that when i assign new
    WndProc, the old one isn't used. And the old one contained just about everything about
    the RichEdit.
    So the result is a RichEdit with only things i did in new WndProc. So things that where in
    previus WndProc ( like TEXT, SCROLLBAR, ...) aren't there, obviusly.
    Can i somehow copy stuff from old WndProc to my New one?
    lu lu lu I've got some apples lu lu lu You've got some too lu lu lu Let's make some applesauce Take off our clothes and lu lu lu

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 02-13-2008, 02:59 PM
  2. edit box
    By beene in forum Windows Programming
    Replies: 3
    Last Post: 11-11-2006, 04:40 AM
  3. edit box affecting displaying of text?
    By algi in forum Windows Programming
    Replies: 4
    Last Post: 05-04-2005, 03:28 PM
  4. How to program a "back" button with MFC
    By 99atlantic in forum Windows Programming
    Replies: 3
    Last Post: 04-26-2005, 08:34 PM
  5. display a file in dropdown edit box
    By sunburnbyRA in forum Windows Programming
    Replies: 2
    Last Post: 03-10-2004, 01:58 PM