How to remove lines around buttons and other items in WinAPI?

Create a button with this method:
hWndButton = CreateWindow(
L"Button",
L"Title",
 IS BS_PUSHBUTTON | BS_TEXT | WS_CHILD | WS_OVERLAPPED | WS_VISIBLE,
100,
100,
100,
50,
hWnd,
NULL,
This
NULL
 );

But after clicking the button, all of it encircled in a black, dotted line.
5ca0aee79308d496513557.png
How to get rid of it?
March 19th 20 at 09:24
1 answer
March 19th 20 at 09:26
Solution
Try this:

SendMessage(hWndButton, WM_CHANGEUISTATE, MAKEWPARAM(UIS_SET, UISF_HIDEFOCUS), 0);


Can send this message to the parent window, and then the focus rectangle should disappear from all child controls.
Great, thank you! - germaine_Jacobi commented on March 19th 20 at 09:29

Find more questions by tags C++