title: How to make a Finder-like Dock menu?
body: <p>When a user clicks on a Dock icon with the right mouse button (Or a command button + mouse click) on a running application - he can see a Dock menu. Which usually consists of 3 parts:</p>
  
  <p><img src="https://i.stack.imgur.com/QXfxa.png" alt="http://i55.tinypic.com/i1for6.png"></p>
  
  <p>a list of all opened documents by this application (red), a custom application's part of the menu (yellow) and default items that are added implicitly to all the items (blue).</p>
  
  <p><a href="http://developer.apple.com/library/mac/#documentation/Carbon/Conceptual/customizing_docktile/concepts/dockconcepts.html#//apple_ref/doc/uid/TP30000986-CH2-SW1" rel="noreferrer">Here</a> apple explains that we can define these custom items (yellow) by implementing an application delegate's method <code>‑(NSMenu *)applicationDockMenu:(NSApplication *)sender</code>, which should return a valid menu (or by defining this Dock menu in Interface Builder).</p>
  
  <p>If you try to open a dock menu for Finder, you can see an unusual menu:</p>
  
  <p><img src="https://i.stack.imgur.com/24Unx.png" alt="Unusual menu"></p>
  
  <p>It is unusual because it does not have ordinary items for quitting and "Options" submenu - as any other launched application would have had by default. Instead it has only "Hide".</p>
  
  <p>I am pretty sure an application or a nib file can override this default "system" (blue) part of a Dock menu. Maybe anyone has any idea how that can be achieved?</p>
  
  <p>I am developing a security application that should not be allowed to quit or selected to be launched "at Login", but it should run all the time when the user is logged in (just like Finder, it may be halted only using Force application to Quit or Activity monitor). I have good reasons to want to get rid of it. I am aware that this is not exactly a Mac OS way, but this is not exactly an ordinary application.
  Have anyone done anything similar?</p>
  
  <p>Thank you</p>