Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cs.utexas.edu!ut-emx!jdm From: jdm@ut-emx.UUCP (Jim Meiss) Newsgroups: comp.sys.mac.programmer Subject: Re: Finding out What Application is Running Summary: Here is what I'm really trying to do.... Keywords: Desk Accessories, CurApName Message-ID: <9112@ut-emx.UUCP> Date: 29 Dec 88 15:45:36 GMT References: <9065@ut-emx.UUCP> <22991@apple.Apple.COM> Organization: The University of Texas at Austin, Austin, Texas Lines: 69 In response to my article Larry Rosenstein writes: dCtlWindow,itemNo),theText); len = pstr_Length(theText); for(i=1;i<=len;i++) { message = (long)theText[i]; PostEvent(keyDown,message); } SendBehind(dce->dCtlWindow,((WindowPeek)dce->dCtlWindow)->nextWindow); if(underExcel) SendBehind(FrontWindow(),((WindowPeek)FrontWindow())->nextWindow); } ------- I have to do a second SendBehind for Excel because it keeps its small edit window as the frontmost window, but this window won't accept keydown events. You have to make the spreadsheet window frontmost first. I don't know how to check to see if this kind of window configuration exists in general. This mght happen with other spreadsheet programs, but I only have Excel. Another case when this could happen is for SuperPaint (and perhaps MacPaint too) which has the pallette windows frontmost always. However, this isn't a big problem because I don't envision anyone using my calculator for a painting program. Finally, this procedure doesn't work under Multifinder unless the option key is used on launch of the DA. However, I wouldn't know how to tell which of the running applications should receive the keydown's anyway. I'd entertain any suggestions about how to detect such a window configuration in general, or if there is something better to do than SendBehind. Thanks; Jim Meiss jdm@emx.utexas.edu