Page 1 of 1

Programming question: What is the X clear search editbox button?

Posted: Sat Feb 26, 2022 5:39 pm
by raccoon
Hi void. Can you tell me what WinAPI and methods are used to create the X ''clear search'' button in the search editbox? Are you using subclassing? If it's simple, could you paste a code snippet?

everything-clear-x-button.png
everything-clear-x-button.png (35.62 KiB) Viewed 8130 times

Re: Programming question: What is the X clear search editbox button?

Posted: Sun Feb 27, 2022 3:08 am
by void
It's my own button class, created with RegisterClassEx.

The class name is EVERYTHING_CLOSE_BUTTON.

The close button window is created as a child of the edit window.

The hardest part is adjust the edit margin so the text doesn't disappear underneath the close button.
I subclass the parent edit window so the close button can be positioned when the edit window is resized.