How to create a normal win32 edit control

c++winapi

I'm trying to create an edit control with the regular 3D border around it (in the classic windows style, anyway), but it just has a 1px black border around it. Here is my CreateWindowEx call:

return CreateWindowEx(0, "EDIT", "E:\\bk",
                      WS_VISIBLE | WS_CHILD | WS_BORDER | ES_LEFT,
                      87, 81, 150, 17,
                      main_window.hwnd,
                      (HMENU)5, hInstance, NULL);

If I exclude WS_BORDER then it's just a white box. Any ideas on what's wrong here?

Update

WS_EX_CLIENTEDGE did the trick.
I don't know anything about manifest files, or how to make the window use the more modern windows themes (XP, for example), instead of the chunky 3D borders. But, when I do learn all that, will WS_EX_CLIENTEDGE make them use those themes instead, or will it enforce the 3D look?

Best Solution

Try using WS_EX_CLIENTEDGE. That will create an inset 3-D window border under typical situations.

return CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "E:\\bk",
                      WS_VISIBLE | WS_CHILD | WS_BORDER | ES_LEFT,
                      87, 81, 150, 17,
                      main_window.hwnd,
                      (HMENU)5, hInstance, NULL);

Also see the following link for the rest of the available flags for CreateWindowEx.

CreateWindowEx at MSDN