• CreateWindow COMBOBOX without any CBS_ style set : what am I getting ?

    From R.Wieser@21:1/5 to All on Sat Dec 24 08:35:06 2022
    Hello all,

    I'm putting a combobox onto a dialog using CreateWindowEx, only setting the WS_VISIBLE and WS_CHILD styles (no CBS_* ones). As a result I get something that looks the same as if I specified the CBS_DROPDOWN style.

    Question : what am I actually getting / whats the difference between no
    style and the CBS_DROPDOW one ?

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JJ@21:1/5 to R.Wieser on Mon Dec 26 00:12:35 2022
    On Sat, 24 Dec 2022 08:35:06 +0100, R.Wieser wrote:
    Hello all,

    I'm putting a combobox onto a dialog using CreateWindowEx, only setting the WS_VISIBLE and WS_CHILD styles (no CBS_* ones). As a result I get something that looks the same as if I specified the CBS_DROPDOWN style.

    Question : what am I actually getting / whats the difference between no
    style and the CBS_DROPDOW one ?

    Regards,
    Rudy Wieser

    Considering that a combobox can only have 3 main styles where all of them
    are non zero, it has to have a default style to represent style with zero value. That default style is CBS_SIMPLE. Whether CBS_SIMPLE is specified or
    not when the control is created, and whether the style value of the created control actually has CBS_SIMPLE or not. It's kind of weird, but that's just
    how it is.

    Some controls would complain if they're created with an invalid style, but
    at least combobox, doesn't complain.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Sun Dec 25 19:49:39 2022
    JJ,

    Considering that a combobox can only have 3 main styles where all
    of them are non zero, it has to have a default style to represent
    style with zero value.

    :-) You're working your way back from the answer to the question, instead
    of starting with the question and try to figure out what the answer is.

    So no, I don't agree with either. 3 is not some magical number and a
    "default style" is, to me, just the 'unspecified behaviour' you're left with when you've handled all specified cases.

    It's kind of weird, but that's just how it is.

    I know it is. Starting with two style values doing the exact same thing is odd. I could have accepted it at the end of the range (styles 4 and
    higher - there seem to room for 16 styles), but not the start. Thats why I
    was asking. :-)

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JJ@21:1/5 to R.Wieser on Mon Dec 26 07:00:44 2022
    On Sun, 25 Dec 2022 19:49:39 +0100, R.Wieser wrote:

    I know it is. Starting with two style values doing the exact same thing is odd. I could have accepted it at the end of the range (styles 4 and
    higher - there seem to room for 16 styles), but not the start. Thats why I was asking. :-)

    Regards,
    Rudy Wieser

    Well, only Microsoft knows why the main style value starts from 1 instead of
    0.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to jj4public@outlook.com on Mon Dec 26 07:44:03 2022
    "JJ" <jj4public@outlook.com> wrote in message news:cuzdapnd05jl$.17yf0pb3dgpym.dlg@40tude.net...

    Well, only Microsoft knows why the main style value starts from 1
    instead of 0.

    I was hoping someone else, hopefully present in this newsgroup, would know
    too. Alas.

    By the way, I probably will throw all the 16 values at it to see if I can
    spot a pattern. Perhaps I will even find another undocumented style !

    And thanks for the reply - even though I seldom seem to be agreeing with you ... :-)

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)