Hello everybody,
I made a toolbar button that creates a popup menu when clicked.? I use GetCursorPos api to position menu.? Now however I want menu to line up with button so I tried this code:
This places the popup menu in lower left screen.? Any suggestions much appreciated.
best regards,
czDrillard
I made a toolbar button that creates a popup menu when clicked.? I use GetCursorPos api to position menu.? Now however I want menu to line up with button so I tried this code:
? ? ? ? ? ? invoke SendMessage,hToolBar,TB_GETRECT,309,ADDR rect
mov ecx,rect.bottom
mov eax,rect.right
? ? ? ? ? ? invoke TrackPopupMenuEx,hFolderListMenu,TPM_RIGHTALIGN or\
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? TPM_BOTTOMALIGN or TPM_RIGHTBUTTON,\
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? eax,ecx,hWndManager,NULL
This places the popup menu in lower left screen.? Any suggestions much appreciated.
best regards,
czDrillard
that function returns caret position, not mouse pointer. you should better get coordinates of pressed toolbar button and calculate, where you want place popup relatively to it.
regards!
regards!
Thanks Shoo for your answer. I'm sending message, TB_GETRECT with button id. This should give me toolbar button coordinates as you suggested. However not working, button ends in lower left screen. How else to get toolbar button coordinates?
best regards,
czDrillard
best regards,
czDrillard