Then auction/trade/send mail/vendor/etc window(frame) is opened, if user pressing right mouse button on an item in his inventory – action happens, like sell item to vendor, or post item to auction, or trade it to stranger etc.
How to do this in my addon? How to get bag+slot user selected item?
I tried to google it in different ways, but failed. Can someone help me with this?
the code that handles item clicking can be found here, but that's probably not what you need, since you need to intercept the clicks on the button frames directly to avoid breaking stuff.
the easiest way to do it is to listen for a modified click, pre-hooking HandleModifiedItemClick shouldn't cause taint.
if you want to listen for simple raw clicks then it gets quite complicated, probably involving invisible secure overlay frames for every item button.