Question

I have three questions about editbox control in WINAPI (i can't find information on msdn about this) 1. How to disable moving typeing cursor with mouse, arrows, backspace in editbox ? I want to make typing like in command line in dos, but with out backspace.

  1. Can I write some piece of text with red color, and another with blue ?

  2. How to write to editbox control from another thread ?

Was it helpful?

Solution

  1. Make it read-only (ES_READONLY) & manually intercept keystrokes and append only those you want to.
  2. No, you would need to use a RICHEDIT class for that and use RTF. (You could owner draw a normal EDIT window but that would not be much fun)
  3. SendMessage with WM_SETTEXT (Or EM_SETTEXTEX / EM_REPLACESEL if you use a RICHEDIT)

Why not use a Console?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top