title: Get NSWindow from kCGWindowNumber
body: <p>From k<code>CGWindowNumber</code>, how do I get <code>NSWindow</code> ref.
  I tried using:</p>
  
  <pre><code>[NSApp windowWithWindowNumber:windowNumber]
  </code></pre>
  
  <p>but I always get a null value.
  I need to get the <code>NSWindow</code> to apply <code>[window setlevel:NSFloatingWindowLevel]</code>, that I have set the always on top of a given window.
  Does anyone know how to solve this problem or has any alternative solution?</p>
  
  <hr>
  
  <p>Thanks for the answer, but this is not the solution, I had already tried but it does not work, actually I did a test , 
  I tried the following code:</p>
  
  <pre><code>for (NSInteger i = 0; i &lt;10000; i + +) {
  NSWindow * wind;
  wind = [NSApp windowWithWindowNumber: windowNumber];
  NSLog (@ "\ n Window:% @", wind);
  }
  </code></pre>
  
  <p>but the result is always the <code>Window: (null)</code></p>
  
  <p>I have a list of window, where can i get OwnerPid Number of window ecc.. ecc... and now  I need to set the always on top of some windows.</p>
  
  <p>The Always on top is possible set whit: <code>[window setlevel:NSFloatingWindowLevel]</code>, window is a <code>NSwindow</code> object, it's real?</p>
  
  <p>Do you have a solution? or another idea , for my problem?</p>