Aaaaaaaaaaaaaah. It makes sense now. messages and such like. my lack of knowledge of win32 shows.

I'll let you know how I get on.

Am I right in thinking the win32 api is awfull?

Chris.

On 02/03/2012 20:16, Tim Roberts wrote:
Chris Ness wrote:
I had decided not to use the command ID technique until I got things
working, so TPM_RETURNCMD was commented out when I defines flags. From
my understanding of MSDN and pywin32, this should make commands
immediately execute and cause TrackPopupMenu to return an HRESULT?
Hmm, I should have read the doc more closely before I replied.  My fault.

I doesn't work quite that automatically.  TrackPopupMenu is a
general-purpose Windows API -- it doesn't have any connection to or
knowledge of Windows Explorer, so it cannot force Explorer to take
actions.  If you don't specify TPM_RETURNCMD, then the final result of
selecting a menu item will be that a WM_COMMAND message sent to your
window.  Your window doesn't know what to do with those command codes,
so nothing useful will happen.  In this particular case, I think you
HAVE to use TPM_RETURNCMD.


_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to