How to prevent an application to become active when clicking in a window ?

How to prevent a click in a window of a background app to make that window and the application its belogns to, to become active ?
The NSWindow methods of interest to you are:
- (BOOL)canBecomeKeyWindow;
- (BOOL)canBecomeMainWindow;
- (BOOL)acceptsFirstResponder;
of NSView:
- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent;
and the style mask during the initialization:
styleMask:(… your app specific other flags… | NSNonactivatingPanelMask)