Pelles C forum

C language => User contributions => Topic started by: DMac on December 24, 2021, 05:55:19 PM

Title: Checked Combobox and Listbox revisited using different aproach
Post by: DMac on December 24, 2021, 05:55:19 PM
Pelles C Forum,

I revisited Checked Combo and List box customization.  This time, instead of wrapping a control in another window, I hook the parent and intercept WM_DRAWITEM.  I was inspired by Pelle's example ODMenu (http://www.smorgasbordet.com/pellesc/sample_odmenu.htm) but found that the application of the technique presented special challenges when it came to individual controls that could be duplicated within a dialog (as opposed to a single toolbar and menu bar) or potentially on two or more dialogs simultaneously.  These controls retain the normal behavior when it comes to item data.  My previous checked controls used the item data to store check state, making it impossible to directly associate user data with the items.

Here are some screen shots of the controls.

(https://www.codeproject.com/KB/Articles/5320735/Figure1.PNG)


(https://www.codeproject.com/KB/Articles/5320735/Figure2.PNG)


Code for the controls can be found with accompanying article (a usage reference) at the code project.

Check It Out 2.0, One Step Win32 SDK C Checked Combo and List Boxes (https://www.codeproject.com/Articles/5320735/Check-It-Out-2-0-One-Step-Win32-SDK-C-Checked-Comb?fid=1979137&df=10000&mpp=50&sort=Position&spc=Relaxed&prof=True&view=Normal)

Regards,
DMac