Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!pacbell.com!pacbell!hoptoad!farcomp!murat From: murat@farcomp.UUCP (Murat Konar) Newsgroups: comp.sys.mac.programmer Subject: Re: How do I get a handle for an existing window? (Think Pascal) Message-ID: <248@farcomp.UUCP> Date: 8 Oct 90 17:54:21 GMT References: <1990Oct6.063726.19882@agate.berkeley.edu> Reply-To: murat@farcomp.UUCP (Murat Konar) Organization: Farallon Computing Inc. Berkeley, CA Lines: 25 In article <1990Oct6.063726.19882@agate.berkeley.edu> bmyers@garnet.berkeley.edu (Brian Myers) writes: >I want to change the title of the Pascal Drawing window from "Drawing" to >something else. I could probably do it by using ShowWindow to bring >the window to the front and the calling the function that gives you the >handle of the active window, but I want a more versatile algorithm that >doesn't require bringing the window to the front. > >There's an assembly language constant called, I think, WindowsList, or somethinglike that, but THINK Pascal doesn't recognize it, so I can't get at the >first entry in the system's linked list of windows. I also can't findi [ the rest deleted] First of all, windows are referred to by pointers not handles. Don't ask me why. Anyhow, there is a call named FrontWindow that takes no arguments and returns a pointer to the front most window. Since all windows of an application are maintained in a linked list, you can walk down the list until you find the window you want. Hope this helps. -- ____________________________________________________________________ Have a day. :^| Murat N. Konar murat@farcomp.UUCP -or- farcomp!murat@apple.com