quote:
Originally posted by CookieRevised
This works perfectly for a Plus! window which you can subclass in Plus!, but does this also work for any other window (eg: a conversation window, as that is what he is asking) which you can not subclass in Plus! scripting?
A very long time ago (before SSS), I did the same: A quick 'n dirty rough test showed that creating (and even showing the context menu) worked fine, but there was no way to detect a click because you couldn't subclass the window which would receive the clicked menu IDs (I tested this on the main contact list iirc).
At least, that was a long time ago without too much looking into it (it was a very quick test), and as far as I can remember so I dunno...
Indeed, you need a subclass window to receive those notifications, but I believe this can be done using a simple Plus! window created solely for that purpose. In Screenshot Sender 5, we use the following interface:
xml code:
<Window Id="Subclass" Version="1">
<Attributes><ShowInTaskbar>false</ShowInTaskbar></Attributes>
<Position Width="0" Height="0"/>
<DialogTmpl/>
</Window>
When the popup menu has to be opened, we create the subclass window (if not already created) and pass its handle as hWnd. As
MSDN puts it: this window receives all messages from the menu. Therefore, it should not make any difference whether the menu was opened because of an event in a chat window or in a Plus! window or any other source. There's no need to subclass the chat window itself, any window will do, including Plus! windows.