🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2
Article #234

Re: Focus cycling

#234
From: Kasey S. Osborn
Date: Wed, 29 Nov 1989 04:00
33 lines
1939 bytes
In article <21629@brunix.UUCP> cs169054@cslab7f.UUCP (Peter Golde) writes:
>>>In article 92, osbornk@uther.CS.ORST.EDU (Kasey S. Osborn) writes:
>>>>However, when it comes to setting the focus to the window that is
>>>>just below the focus window, I am having difficulty.  Somehow I need
>>>>to make the focus window become the bottommost window.  This is what
>>>>OS/2 does to windows listed in Task List when one hits Alt-Esc.
>
>How about, in each of the subwindow's window procedures, whenever they
>loses the focus or become de-activated, setting themselves to the 
>bottom most window (with WinSetWindowPos).  I.e., the window procedure

This looks like the solution.  It seems strange using WinSetWindowPos
to do something other than set coordinates, but it does the job.

One catch:  the focus does not automatically move to the new topmost
window after the call to WinSetWindowPos.  My code looks like this:

{
  HWND *ParentWindow, *Window, *ChildClientWindow;

  // Get client's frame handle.
  Window = WinQueryWindow (hWnd, QW_PARENT, FALSE);

  // Move topmost window to the bottom.
  WinSetWindowPos (Window,
		   HWND_BOTTOM,     // Put tuple at the bottom.
		   0, 0,	    // Ignored.
		   0, 0,	    // Ignored.
		   SWP_ZORDER);     // Look at hwndInsertBehind.

  // And later...
  WinSetFocus (HWND_DESKTOP, ChildClientWindow);
}
Technical Details
Message-ID: <14029@orstcs.CS.ORST.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!caesar.cs.montana.edu!ogccse!orstcs!uther.CS.ORST.EDU!osbornk
References: <627646071.19046@minster.york.ac.uk> <13958@orstcs.CS.ORST.EDU> <21629@brunix.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!caesar.cs.montana.edu!ogccse!orstcs!uther.CS.ORST.EDU!osbornk
From: osbornk@uther.CS.ORST.EDU (Kasey S. Osborn)
Newsgroups: comp.os.os2
Subject: Re: Focus cycling
Message-ID: <14029@orstcs.CS.ORST.EDU>
Date: 29 Nov 89 04:00:13 GMT
References: <627646071.19046@minster.york.ac.uk> <13958@orstcs.CS.ORST.EDU> <21629@brunix.UUCP>
Sender: useneta@orstcs.CS.ORST.EDU
Reply-To: osbornk@uther.CS.ORST.EDU (Kasey S. Osborn)
Organization: Oregon State Univ. - CS - Corvallis, OR
Lines: 33