Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!caen!uflorida!shark!jboser From: jboser@cs.fau.edu (Jeff Boser) Newsgroups: comp.sys.mac.programmer Subject: Windows and backgrounding. Message-ID: <1991Jun14.165011.7929@cs.fau.edu> Date: 14 Jun 91 16:50:11 GMT Organization: Florida Atlantic University, Boca Raton Lines: 34 I have an application that I want to run in the background. It has a small loop that executes upon null events that starts with FrontWindow(), and performs a procedure based upon the windowKind and refCon fields of each window, until it hits the end of the window list. this is the code: WindowPeek v, w = FrontWindow(); while (w != nil) { v = w->nextwindow; /*the next call could get rid of w*/ /*the call is here*/ w = v; } It runs fine in the foreground, but I think the problem is this: Each application/layer has its own list of windows, ending in null. FrontWindow() returns the front window of the *TOP* layer, not the calling layer. I cant grab the front window on suspend, as the calling loop may dispose of it. What I need is a way to get the front window of my layer while it is in the background. I might be missing something really stupid, as I am currently wired and tired. If anybody has any ideas, please send me them, it would be most appreciated. .....jeff jboser@tuna.cs.fau.edu -- "Make something an idiot can use, and only an idiot will use it." - RAH Like a bible, maybe? - me