Announcement

Collapse

Maintenance

The forum could be offline for 30-60 minutes in the very near future for maintenance (said 3pm Pacific). I was behind on getting this notice. I do apologize.
See more
See less

%BS_OWNERDRAW and Enter

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • %BS_OWNERDRAW and Enter

    Guys --
    a form has three buttons with id 115-117. Control Add are located in the same order (115..117).
    Focus has id #115. If to use ordinary buttons, Enter generates WM_COMMAND with CbCtl = 115.
    But if to add %BS_OWNERDRAW style, CbCtl = 117.

    Something strange (I think in IsDialogMessage). How to bypass this behaviour by more or less "normal" way (w/o changes in message loop, subclassing ...) ?

    ------------------
    E-MAIL: [email protected]

  • #2
    Hi Semen, I'm just guessing, but have you tried setting the focus
    on the button (115?) that you want active with the enter key?

    Perhaps the owner draw is changing the focus?!?



    ------------------
    Bernard Ertl
    Bernard Ertl
    InterPlan Systems

    Comment


    • #3
      Bern --
      Yes, 115 has focus (100% sure).
      I read about IsDialogMessage and added to DlgProc
      Code:
        Case %DM_GETDEFID ' = WM_USER
           Function = MakDwd(115, %DC_HASDEFID)
      All is nice, except - now I can't understand why changing to Function = MakDwd(116, %DC_HASDEFID) doesn't make 116 as default (remains 115).



      ------------------
      E-MAIL: [email protected]

      Comment


      • #4
        Sorry I can't be of more help. I'm still learning this stuff.

        Have you tried changing the ID of the 115 button to %IDOK, or
        is that not an option?



        ------------------
        Bernard Ertl
        Bernard Ertl
        InterPlan Systems

        Comment


        • #5
          Sounds like the dialog relates to last control created for ownerdrawn
          style and first control created for standard style. Change order of
          creation when using ownerdrawn controls?


          ------------------

          Comment


          • #6
            It seems to me I found a "normal", documented way (works at least, under Windows 2000)
            Code:
            Dialog Send CbHndl, %DM_SETDEFID, x, 0  (x = 115..117)
            (w/o Case %DM_GETDEFID ...)

            ------------------
            E-MAIL: [email protected]

            Comment

            Working...
            X