In Windows platform a window has an attribute named SWP_NOACTIVATE that causes the window displayed inactive and also after mouse click, that window does not gain focus, It is useful for example to virtual keyboards that you can type by mouse click. what is equivalent solution in Mac? In other words how can I implement a window that does not change focus on click it? thanks.
You'll want to read Key and Main Windows in the Window Programming Guide. Briefly, create your own NSWindow subclass and override -canBecomeKeyWindow
and -canBecomeMainWindow
so that both return NO:
...a window that acts as a floating palette of items that are only dragged out by mouse actions never needs to be the key window. Such a window can be defined as a subclass of NSWindow that overrides the methods canBecomeKeyWindow and canBecomeMainWindow to return NO instead of the default of YES. Defining a window this way prevents it from ever becoming the key or main window.