C++/Creating a button control
How can I create a button control, not a regular one, but a white button with a blue frame that changes into orange frame when the mouse cursor is on the button ? (Like the buttons in Microsoft Internet Explorer 6.0 &
Like the buttons in this very page (I Agree, Cancel ))
Gil , Thank you for your question.
To change the appearance of all buttons on your computer, select Appearance in the Display Properties of your computer.
To set the properties of just one button in an application, intercept certain Windows messages (such as WM_CTLCOLORBTN) sent to that button or to the parent of the button, which is the dialog box in which that button appears. Further information is contained in the Buttons topic in the MSDN Library. You can search Microsoft's MSDN Library at http://search.microsoft.com/us/dev/default.asp
I have searched Microsoft's MSDN Library and I couldn't find a source code (or an example) how to create such a button.
Can you give me a source code for creating this button control ?
(I program Microsoft Visual c++ 6.0, Win32 App)
Gil Michael, Thank you for your question.
To create a button, select the menu item to add a new Resource, and choose Dialog box. Next, edit the new dialog box in the Dialog Box Editor and add a button by dragging and dropping a button from the toolbox.
To intercept messages, add a dialog box procedure to your application. The topic "Button Color Messages" discusses the messages, and the "CreateDialog" topic discusses how to create a dialog box. The "DialogProc" topic discusses dialog box procedures.
The above assumes you are using Win32, not MFC.
I suggest that you read the MSDN Library topics about dialog boxes and controls thoroughly. This will give you the knowledge you need to solve your problem. If you find the MSDN Library difficult to understand, consult books about Windows programmaming such as Programming Windows by Charles Petzold.