Author Topic: Rebar control who don't want to change the size of the band  (Read 419 times)

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Hello,
This one works correctly with Four bands,two with a combobox ,one with a Toolbar,one with an up_down.
There is just a little problem,One click on the band don't maximize or minimize the band.
Normally,there is no need to proceed any message to do that.
The WM_MOUSE CLIC message is not sended to the parent window and normally it's the rebar control who do that.
I have tested may styles to try to solve the problem.
I have the same toolbar working in my IDE  :mrgreen: and I dont find what is the problem.
Any Help ?
see last post
« Last Edit: July 24, 2021, 04:47:58 PM by TouEnMasm »
Fa is a musical note to play with CL

six_L

  • Member
  • **
  • Posts: 226
Re: Rebar control woho don't want to chage the size of the band
« Reply #1 on: July 23, 2021, 07:38:51 AM »
   .elseif eax==WM_NOTIFY
      
      mov   rax,lParam
      .if   [rax].NMHDR.code==RBN_HEIGHTCHANGE
         invoke SendMessage,hWin,WM_SIZE,0,0
      .endif

   .elseif eax==WM_SIZE

      invoke   GetClientRect,hWin,addr rect1
      ;Size rebar
      invoke   GetDlgItem,hWin,IDC_REB1
      mov   hReb,rax
      invoke   GetClientRect,hReb,addr rect
      invoke   MoveWindow,hReb,0,2,rect1.right,rect.bottom,TRUE
Say you, Say me, Say the codes together for ever.

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: Rebar control woho don't want to chage the size of the band
« Reply #2 on: July 23, 2021, 04:05:00 PM »


A clic on the band don't change the height but only the length.
The RBN_HEIGHTCHANGE can do nothing
Fa is a musical note to play with CL

six_L

  • Member
  • **
  • Posts: 226
Re: Rebar control woho don't want to chage the size of the band
« Reply #3 on: July 23, 2021, 04:10:58 PM »
Do i not understand correctly your problem?
x64
Say you, Say me, Say the codes together for ever.

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: Rebar control woho don't want to chage the size of the band
« Reply #4 on: July 23, 2021, 04:47:46 PM »
Hello,
With no source code I couldn't do manything.
Fa is a musical note to play with CL

jj2007

  • Member
  • *****
  • Posts: 11551
  • Assembler is fun ;-)
    • MasmBasic
Re: Rebar control woho don't want to chage the size of the band
« Reply #5 on: July 23, 2021, 06:54:12 PM »
A clic on the band don't change the height but only the length.
The RBN_HEIGHTCHANGE can do nothing

There are a few others that you could test. Or do you prefer that six_L does the testing for you?

Code: [Select]
RBN_HEIGHTCHANGE               equ RBN_FIRST - 0
RBN_GETOBJECT  equ RBN_FIRST - 1
RBN_LAYOUTCHANGED              equ RBN_FIRST - 2
RBN_AUTOSIZE   equ RBN_FIRST - 3
RBN_BEGINDRAG  equ RBN_FIRST - 4
RBN_ENDDRAG    equ RBN_FIRST - 5
RBN_DELETINGBAND               equ RBN_FIRST - 6
RBN_DELETEDBAND                equ RBN_FIRST - 7
RBN_CHILDSIZE  equ RBN_FIRST - 8

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: Rebar control woho don't want to chage the size of the band
« Reply #6 on: July 23, 2021, 07:28:55 PM »

I have added some notify messages to the original source code
Code: [Select]
Notify_Rebar PROC uses ebx uMsg:DWORD, wParam:DWORD, lParam:DWORD
Local  retour:DWORD
         mov retour,0
;uMsg = WM_NOTIFY et edx = hInstance Hrebar
mov     ebx, lParam          ; Get pointer to NMHDR
mov     eax, (NMHDR ptr [ebx]).code ;ex:TTN_NEEDTEXT ou EN_SELCHANGE
mov     edx,(NMHDR ptr [ebx]).hwndFrom
; valeur de retour ignorée sauf specification contraire
.if eax == RBN_CHILDSIZE
;invoke MessageBox,NULL,TXT("ien"),TXT("rty"),MB_OK
;ebx pointe NMREBARCHILDSIZE
;invoke SendMessage,Htoolbar,RB_SETBANDWIDTH,0,100
;Band's child window has been resized
.elseif eax == RBN_DELETEDBAND
;Band has been deleted
.elseif eax == RBN_DELETINGBAND
;Band is about to be deleted
.elseif eax == RBN_ENDDRAG
;User stopped dragging a band
.elseif eax == RBN_BEGINDRAG
;User began dragging a band
.elseif eax == RBN_AUTOSIZE
;Control has resized
.elseif eax == RBN_LAYOUTCHANGED
;Change in band layout
.elseif eax == RBN_GETOBJECT
;Object dragged over a band
.elseif eax == RBN_HEIGHTCHANGE
;invoke SendMessage,edx,WM_SIZE,0,0
;Control height changed
.elseif eax == RBN_CHEVRONPUSHED
.elseif eax == RBN_SPLITTERDRAG
.elseif eax == RBN_MINMAX
invoke MessageBox,NULL,TXT("ien"),TXT("RBN_MINMAX"),MB_OK
.elseif eax == NM_CUSTOMDRAW
;Custom draw request notification
;ebx NMCUSTOMDRAW
.elseif eax == NM_NCHITTEST
;Control received a non-client hit test
;ebx NMMOUSE
.elseif eax == NM_RELEASEDCAPTURE
;Control is releasing mouse capture
.elseif eax == NM_CLICK OR NM_LDOWN
.elseif eax == NM_DBLCLK
invoke MessageBox,NULL,TXT("ien"),TXT("NM_DBLCLK"),MB_OK
.else
;invoke MessageBox,NULL,TXT("ien"),TXT("rty"),MB_OK
.endif

 FindeNotify_Rebar:
         mov eax,retour
         ret
Notify_Rebar endp


The NM_CLICK OR NM_LDOWN notifies who can be useful aren't send to the parent window.
It is the same with WM_MOUSE xx .
The execution of the maximize or minimize lenght of a band is internal to the band and when there is a problem there is not too many soluces.




Fa is a musical note to play with CL

TouEnMasm

  • Member
  • *****
  • Posts: 1805
    • EditMasm
Re: Rebar control woho don't want to chage the size of the band
« Reply #7 on: July 24, 2021, 04:45:02 PM »
Hello,
Finally found.
All notify messages of the rebar must be treat by DefWindowProc
Code: [Select]
.elseif uMsg == WM_NOTIFY
mov     ebx, lParam          ; Get pointer to NMHDR
mov     eax, (NMHDR ptr [ebx]).code ;ex:TTN_NEEDTEXT ou EN_SELCHANGE
mov     edx,(NMHDR ptr [ebx]).hwndFrom
; valeur de retour ignorée sauf specification contraire
.if edx == Hrebar
jmp AutomatiqueMessage    ; INVOKE     DefWindowProc, hwnd, uMsg, wParam, lParam
invoke Notify_Rebar,uMsg, wParam, lParam
.endif
Fa is a musical note to play with CL