home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!gumby!yale!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!tamsun.tamu.edu!zeus.tamu.edu!sam4628
- From: sam4628@zeus.tamu.edu
- Subject: Re: Changing Window's focus: possible?
- Message-ID: <6NOV199207570849@zeus.tamu.edu>
- News-Software: VAX/VMS VNEWS 1.41
- Sender: news@tamsun.tamu.edu (Read News)
- Organization: Texas A&M University, Academic Computing Services
- References: <4NOV199210331435@zeus.tamu.edu> <682@lax.lax.pe-nelson.com> <1992Nov5.145745.3278@hyper.hyper.com>
- Date: Fri, 6 Nov 1992 13:57:00 GMT
- Lines: 32
-
- >>In article <4NOV199210331435@zeus.tamu.edu>, sam4628@zeus.tamu.edu writes:
- >>|> Is it possible to write a program which changes the way Windows focuses?
- >>|> I would like the active window to be selected by mouse pointer position,
- >>|> without necessarily bringing the window to the front. Has anybody done
- >>|> anything similar to this? Thanks.
-
- To follow up on my original post: I have managed to write a program which
- brings to the front and makes active whichever window the mouse cursor is
- over. There are still a few (major) problems:
-
- When I bring up a menu and move the mouse down, the menu disappears (I
- think I can solve this problem by only changing focus when the mouse
- moves to a different parent window). The other problem is that the
- newly focussed window is automatically brought forward -- I would like
- to be able to have an overlapped active window.
-
- The program so far just sets a hook for mouse messages which uses
- WindowFromPoint to get the handle of the window located at the cursor
- position (if any) and SetFocus to change the focus to that window.
- (SetFocus must be responsible for bringing the focussed window forward --
- I don't know if there's a simple way around this.)
-
- Just in case anybody is inclined to tell me what a stupid idea and/or
- method this is, bear in mind that this is the first windows program I've
- ever written.
-
- Steven M.
-
- P.S. I typed in the HELLOWIN example out of Petzold (using BC++) and got
- it to work with minor mods. However, I get a warning that I'm trying to
- export a non-public function when I include my window proc in the EXPORT
- line of the DEF file. Any suggestions?
-