Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c++ win32 create a text only button

Tags:

c++

button

winapi

I would like to add a simple text button to my c++ win32 application. I'm creating the button using CreateWindowEx function, but can't figure out the correct style to do so. I would like to display a text only button and be able to recive messages when the user clicks on it. The style i would like to get is identical to the text button in windows 7 system volume control (where it says "Mixer"). If possible i would like to display a tooltip also.

enter image description here

like image 524
blejzz Avatar asked Mar 24 '26 10:03

blejzz


2 Answers

That mixer control looks more like a hyperlink control than a button. I'd go for the SysLink control if that's what you need.

like image 75
David Heffernan Avatar answered Mar 27 '26 02:03

David Heffernan


You could create a "Button" class window with the BS_OWNERDRAW style and handle the WM_DRAWITEM messages. In your WM_DRAWITEM message handler you can simply display the text.

like image 33
Jim Rhodes Avatar answered Mar 27 '26 01:03

Jim Rhodes