How to create a regular win32 control?

I am trying to create an edit control with the usual three-dimensional border around it (in any case, in the classic Windows style), but there is only 1px black border around it. Here is my call to CreateWindowEx :

 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 this is 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 a window more modern, such as Windows (instead of XP), instead of short three-dimensional borders. But when I find out all this, will WS_EX_CLIENTEDGE force them to use these themes instead, or does it provide a 3D look?

+4
source share
3 answers

Try using WS_EX_CLIENTEDGE. This will create a three-dimensional window frame in 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 remaining available flags for CreateWindowEx.

CreateWindowEx on MSDN

+6
source

He is right. WS_EX_CLIENTEDGE will execute a three-dimensional border.

+3
source

I think you mean the WS_EX_DLGMODALFRAM E style. This makes it look like an old-fashioned 3d style. Combined with WS_BORDER to make it look like a three-dimensional border around a control.

+1
source

Source: https://habr.com/ru/post/1286039/


All Articles