• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: What happened to NSConvertWindowNumberToGlobal
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What happened to NSConvertWindowNumberToGlobal


  • Subject: Re: What happened to NSConvertWindowNumberToGlobal
  • From: Finlay Dobbie <email@hidden>
  • Date: Sat, 2 Nov 2002 23:24:30 +0000

On Saturday, November 2, 2002, at 11:10 pm, Peter Fischer wrote:

NSWinow's api refers to the functionNSConvertWindowNumberToGlobal, yet I can't seem to find this function anywhere. I have found references to it on the web, and that it resides in NSGraphics.h, but It doesn't appear to be there anymore.
I'm looking to gain control over windows outside the scope of my application. I am able to get all of the numbers of other windows via calls to NSCountWindows and NSWindowList, but when I try to obtain a reference to an NSWindow using the window number, the only valid window references that I obtain, are windows spawned by my own application. NSConvertWindowNumberToGlobal appears to be the function I am looking for, giving the the global window number that the WindowServer uses to reference it.
Has this function no longer supported, and if not, will the function provide the functionality that I am looking for? If it is no longer supported, is there another way to go about this?

I think that there is no longer any difference between global and local window numbers, that was a holdover from the days of DPS. At least, I've only ever seen one numbering scheme, CGSWindowNumber, and that is global.

However, there is no (public) way to get a reference to windows outside your application, and even if you could, you would not be able to modify them without jumping through some serious hoops. Every application has a connection to the windowserver, and it can only write to windows that it "owns" (i.e. that it created). You can however read from them using private windowserver API calls, and with a bit of poking (forcibly loading yourself into the Dock and using its god-like status hack which enables it to minimize windows and so on to "promote" your app's connection to similar god-like status), you can write properties, but since you're mucking with low-level windowserver calls you can cause problems with things in high-level APIs not tracking the changes correctly.

The fact that NSCountWindows and NSWindowList are public is probably a bug, I can't really see any useful purpose without using other private functions.

-- Finlay
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >What happened to NSConvertWindowNumberToGlobal (From: Peter Fischer <email@hidden>)

  • Prev by Date: What happened to NSConvertWindowNumberToGlobal
  • Next by Date: Re: metallized interface (offtopic rant)
  • Previous by thread: What happened to NSConvertWindowNumberToGlobal
  • Next by thread: NSSound: Why Doesn't This Work?
  • Index(es):
    • Date
    • Thread