Click to See Complete Forum and Search --> : How do I change button states via SW (rather than mouse)
Herbert Oleen
June 9th, 1999, 03:19 PM
I want to manipulate the state of a button control (selected, focused, down, deselected) via SW data rather than from a mouse click. I'll liken this to player piano keys moving via the music roll. I need a push in the right direction and any suggestions are appreciated. This is my second request. Someone please respond.
Herbert Oleen
June 25th, 1999, 06:46 AM
I guess I have to answer my own question. I figured out that resources can be manipulated to simulate button clicks etc. by sending messages to the resource using the following code:
::SendMessage(GetDlgItem(nButtonID)->m_hWnd, BM_CLICK, TRUE, 0);
and the various button messages. Thanks to myself.
Andrew Bantly
June 25th, 1999, 07:30 AM
I have accomplished this using owner draw buttons. In my code, I assigned member variables to the buttons as type CButton, then manually changed them from this to CBitmapButton. This class allows you to load bitmap images that correspond to each button state. Hope this helps. For more info, just email me at abantly@hotmail.com. I'd be willing to share source code.
Andy
Herbert Oleen
June 25th, 1999, 07:36 AM
Deja vu, that's precisely what I did in building my multimedia components. Thanks. I've noted your e-mail and hope you do the same.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.