Hiya peterg70,
I'll just throw out my 2 cents here...
First, what type of combo box are you dealing with here? Generally speaking, a combo box is made up of an edit control AND a list box. Depending on the window style, however, it may only have the edit box or the list box component.
------------------------------------------------------------------------------------------------------------------------------------------------
The following list shows the three combo box types and indicates whether each includes a drop-down list and an edit control:
Combo box type: Drop-down combo box
Drop-down list = Yes
Edit control = Yes
Combo box type: Drop-down list box
Drop-down list = Yes
Edit control = No
Combo box type: Simple combo box
Drop-down list = No
Edit control = Yes
------------------------------------------------------------------------------------------------------------------------------------------------
So, I guess what I'm asking is... Are you trying to modify the *type* of combo box from say a Drop-down combo box to a Drop-down list combo box or are you trying to change the Combo Box to an entirely new "List Box" control.
The first modification would be a simple change of window style (CBS_DROPDOWNLIST specifying a Drop-down list for example). Although it's probably the most straight forward to make the changes in a resource editor as you've been attemping, changing the window style run-time is another option.
The SetWindowLong function changes an attribute of the specified window. The function also sets a 32-bit (long) value at the specified offset into the extra window memory of a window.
------------------------------------------------------------------------------------------------------------------------------------------------
LONG SetWindowLong(
HWND hWnd, // handle of window
int nIndex, // offset of value to set
LONG dwNewLong // new value
);
Parameters
hWnd
Identifies the window and, indirectly, the class to which the window belongs.
nIndex
Specifies the zero-based offset to the value to be set. Valid values are in the range zero through the number of bytes of extra window memory, minus 4; for example, if you specified 12 or more bytes of extra memory, a value of 8 would be an index to the third 32-bit integer. To set any other value, specify one of the following values:
Value Action
GWL_EXSTYLE Sets a new extended window style.
GWL_STYLE Sets a new window style.
GWL_WNDPROC Sets a new address for the window procedure.
GWL_HINSTANCE Sets a new application instance handle.
GWL_ID Sets a new identifier of the window.
GWL_USERDATA Sets the 32-bit value associated with the window. Each window has a corresponding 32-bit value intended for use by the application that created the window.
------------------------------------------------------------------------------------------------------------------------------------------------
If, however, you're trying to change the control to an *entirely* new control type (ie. from a "Combo Box" to a "List Box"
, then you're dealing with a whole different animal. Changing the control in the resource editor will not be enough. Functionality will have to be modified to account for the differences in message handling between Combo Boxes and the List Boxes. For example, if your combo box is initialized with strings it may be using the CB_ADDSTRING message to add those strings. If you changed this to a List Box you'd have to hunt down this CB_ADDSTRING and change it to its equivalent LB_ADDSTRING message.
I didn't see a reference to your target... So to be honest, I proably don't have a clear grasp of what you're trying to accomplish. I'm just throwing out a couple of ideas that may / may not be related to your problem at hand
Cheers,
Clandestiny