When you call EnableExtendedMouseEvents, you tell it which control you want to receive the extended mouse event. It sounds like you told it to use the callback for the graph control. The extended mouse events will be handled by the callback for control you specified in EnableExtendedMouseEvents regardless of where the event took place.
What do you want to do on EVENT_LEFT_MOUSE_UP? If you don't want to handle it, don't include a case for it. If you want to handle it for some other control or for the panel, you can set a global flag for EVENT_LEFT_CLICK in the callback for that control or panel. You won't have EVENT_LEFT_MOUSE_UP without first getting EVENT_LEFT_CLICK. Then in the callback specified in EnableExtendedMouseEvents, check if the global is set, handle the EVENT_LEFT_MOUSE_UP as desired, then clear the global flag for EVENT_LEFT_CLICK.