win32 select all on edit ctrl (textbox)

c++, textbox, user-interface, winapi

Solution

I tend to use MFC (forgive me) instead of Win32 so I cannot answer this definitively, but I noticed this comment added to a page on an MS site concerning talking with an Edit control (a simple editor within the Edit control):

The edit control uses `WM_CHAR` for accepting characters, not `WM_KEYDOWN` etc. You must `Translate()` your messages or you ironically won't be able to edit the text in the edit control.

I don't know if this applies to BoltBait's response, but I suspect it does.

(I found this at http://msdn.microsoft.com/en-us/library/bb775462(VS.85).aspx)

Problem

I am creating my textbox with these options. I can Copy / Cut / Paste / Undo, but when I hit Select All it doesn't select all. I can right click and click Select All but CTRL + A doesn't do anything. Why? ``` wnd = CreateWindow("EDIT", 0, WS_CHILD | WS_VISIBLE | ES_MULTILINE | WS_HSCROLL | WS_VSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL, x, y, w, h, parentWnd, NULL, NULL, NULL); ```

Original source