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:
? ? ? ? ? ? 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
Posted on 2005-06-09 09:15:45 by 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!
Posted on 2005-06-09 09:41:53 by Shoo
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
Posted on 2005-06-10 08:37:54 by czDrillard