Thanks for the response. I have managed to get it working. According to the documentation, the default implementation of OnLButtonDown() calls the CWnd::SHRecognizeGesture method that allows the OS to send GN_CONTEXTMENU to the parent window.
I have overridden the OnLButtonDown method and I don't call the OnLButtonDown() method of the base class in my new method (which would obviously then still have the undesired behaviour). I'm not 100% sure if this is the best way of doing it, since I'm still getting to grips with MFC programming in general. If anyone has other ideas, please post them.