Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting enumeration of open windows

0 views
Skip to first unread message

Mark Smith

unread,
Jun 1, 2002, 9:26:03 PM6/1/02
to
I have a little problem I'm researching and can't find an answer. I
can do this under X-Windows but cannot find a way under Aqua and
Cocoa.

I'm writing a utility that needs to get an enumeration of current open
windows on the desktop. I specifically need to get handles/references
to all windows that have a parent of the root so I can inspect certain
properties they all have.

Does anyone have any clue how to do this or where I can look for more
info? I've scoured the Apple site plus the docs in the developer's
tools.

Eric Albert

unread,
Jun 1, 2002, 9:54:27 PM6/1/02
to
In article <be97a6d7.02060...@posting.google.com>,
tdur...@hotmail.com (Mark Smith) wrote:

You can't do this. If you can describe what you're trying to accomplish
with this, perhaps we can suggest a different way to solve the problem.

-Eric

--
Eric Albert ejal...@stanford.edu
http://rescomp.stanford.edu/~ejalbert/

William Woody

unread,
Jun 2, 2002, 2:03:31 AM6/2/02
to

Short answer: I seriously doubt you will be able to do this. That is, I
seriously doubt in MacOS X you will be able to obtain a list of
currently open windows, and query for information about those windows.


--
William Edward Woody - wo...@alumni.caltech.edu
In Phase Consulting - http://www.inphase.org
The PandaWave - http://www.pandawave.com
Macintosh and Microsoft Windows Custom Development

Mark Smith

unread,
Jun 2, 2002, 10:51:38 PM6/2/02
to
I want to write a browser "popup killer" along the lines of the now
defunct PopupKiller for Windoze. It works by examining the title bar
of each new window that is opened and matching against a list of
regular expressions that can be edited by the user.

If I can find some way of (a) being notified when any new window is
opened and, (b) getting to the window information and examining the
title.

I was hoping that something in OSX would allow me to do it (like I
mentioned before I can do it in XWindows and M$ Windoze).

I guess my next impossible task is finding a way of forcing all
browser http requests through a local ghost proxy and filtering the
actual HTML content there on the return trip back to the browser.

Michael Ash

unread,
Jun 2, 2002, 11:23:18 PM6/2/02
to

> I want to write a browser "popup killer" along the lines of the now
> defunct PopupKiller for Windoze. It works by examining the title bar
> of each new window that is opened and matching against a list of
> regular expressions that can be edited by the user.

Just use OmniWeb. In the JavaScript pane of its preferences, there's an
option titled "Scripts are allowed to open new windows:" with the
choices "always", "only in response to a link being clicked", and
"never".

I have no idea why this hasn't made it into things like IE.

> I guess my next impossible task is finding a way of forcing all
> browser http requests through a local ghost proxy and filtering the
> actual HTML content there on the return trip back to the browser.

You don't *force* the requests, you use the built-in browser preferences
and point the browser to your proxy, no impossibility or magic involved.

Eric Albert

unread,
Jun 2, 2002, 11:56:15 PM6/2/02
to
In article <mail-00F8D0.2...@corp.supernews.com>,
Michael Ash <ma...@mikeash.com> wrote:

> In article <be97a6d7.02060...@posting.google.com>,
> tdur...@hotmail.com (Mark Smith) wrote:
>
> > I want to write a browser "popup killer" along the lines of the now
> > defunct PopupKiller for Windoze. It works by examining the title bar
> > of each new window that is opened and matching against a list of
> > regular expressions that can be edited by the user.
>
> Just use OmniWeb. In the JavaScript pane of its preferences, there's an
> option titled "Scripts are allowed to open new windows:" with the
> choices "always", "only in response to a link being clicked", and
> "never".
>
> I have no idea why this hasn't made it into things like IE.

Mozilla has the same feature, as does iCab, leaving IE as the only
widely-used Mac browser that doesn't support it.

John C. Randolph

unread,
Jun 3, 2002, 5:38:02 AM6/3/02
to

/Developer/Applications/Quartz Debug does what you're describing.

Drop me a note on Monday at work, jcr at apple, and I'll ask whether the
API it uses is public or not.

-jcr

Mark Smith

unread,
Jun 3, 2002, 2:39:06 PM6/3/02
to
The reason I'm trying to write my own is that these other browsers'
solutions to the problem are "all or nothing." I like the regex
control of PopupKiller so that I see the ones I want and ignore the
rest.

Eric Albert <ejal...@stanford.edu> wrote in message news:<ejalbert-1409EF...@usenet.stanford.edu>...

Michael Ash

unread,
Jun 3, 2002, 2:41:47 PM6/3/02
to

> The reason I'm trying to write my own is that these other browsers'
> solutions to the problem are "all or nothing." I like the regex
> control of PopupKiller so that I see the ones I want and ignore the
> rest.

Well, OmniWeb has the "only in response to clicking on a link" option. I
guess I've never seen a popup I wanted that wasn't in response to
clicking on a link. Anyway, I'm afraid I can't help you with your real
question.

John C. Randolph

unread,
Jun 4, 2002, 4:59:49 AM6/4/02
to

Mark Smith wrote:
>
> The reason I'm trying to write my own is that these other browsers'
> solutions to the problem are "all or nothing." I like the regex
> control of PopupKiller so that I see the ones I want and ignore the
> rest.

Not true for OmniWeb. In OW preferences, under "privacy", you can give
it a list of regex's to avoid. I'm using:

/.*\.doubleclick\.net/
/ads\..*\.com/
/ads\..*\.net/

and it's great to get pages without the banner ads, too.

-jcr

0 new messages