   [C++, Win32] How to make buttons stay down
  Hey guys !I'm working on an application where I want certain buttons to stay down after I've pushed them, a sort of toggle effect which persists even when I go on to focus other windows in the application. I create the buttons using CreateWindowEx() with "button" as the class name as I guess most would expect, and I've tried to control the button state with Button_SetState() any time the button is identified in a WM_COMMAND message. However this doesn't work quite the way I had hoped as the button gets reset anytime I switch focus to another window (within the same window) and sometimes the button isn't pushable at all.Is there any straight-forward solution to my problem, I would much appreciate any advice.- Dave   
  Well, what you want is a the behavior of a checkbox but the appearance of a button. I have never tried this in pure Windows API but I would try to retrieve the WndProc for a button and checkbox class and write a new WndProc for my custom button class which forwards everything except painting related messages (not sure if WM_PAINT is enough) to the checkbox WndProc and the painting messages to the button WndProc.   ;BS_PUSHLIKE will give a button that looks like a normal button but behaves like a checkbox.   ;  Ah, using the style BS_AUTOCHECKBOX | BS_PUSHLIKE | WS_CHILD | WS_VISIBLE did the trick. Thanks guys !   