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
.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
A clic on the band don't change the height but only the length.
The RBN_HEIGHTCHANGE can do nothing
Do i not understand correctly your problem?
x64
Hello,
With no source code I couldn't do manything.
Quote from: TouEnMasm 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
There are a few others that you could test. Or do you prefer that six_L does the testing for you?
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
I have added some notify messages to the original source code
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.
Hello,
Finally found.
All notify messages of the rebar must be treat by DefWindowProc
.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