[comp.os.os2.programmer] Minimized windows and Icons

cpa@bnlux0.bnl.gov (Chris Armstrong) (11/03/90)

I have a program which would sometimes like to show an Icon when it is 
minimized and at other times just show a very small version of the graph in
the window.  I know how to do these things separately but I can't seem to
switch between the two states.  It seems that if the FCF_ICON or the FS_ICON
flags are not set when the frame is created (in this case with WinCreateStd
Window) then there is no way the frame will use an icon itself.  I've tried
using the WinCreateFrameControls function from my window processing function
with no luck.  Does anyone know if there is any way to tell the frame window
to use an icon even when it wasn't created with the _ICON flags.  Or if it
is created with the _ICON flags how to tell it not to use the icon.  I've
also tried sending the frame window the SETICON message, again with no luck.
So far the best I've managed to come up with is to create the frame without the
_ICON flags and to draw an icon if the WM_PAINT message detects that the window
is minimized.  To get the minimized icon to be dragged by the mouse I have to
use the WM_MOUSEMOVE message and query whether the window is minimized each
time which is somewhat clumsy.

Any insight would be appreciated,

Chris Armstrong

lsalomo@hubcap.clemson.edu (lsalomo) (11/07/90)

Why don't you create the frame WITH the FCF_ICON bit set, subclass it, and
in your subclass procedure, check to see what needs to be drawn under
WM_MINMAXFRAME?  If the ICON is to be drawn, return (*pOldFrameProc), else
do your processing...

To check what is happening with WM_MINMAXFRAME...

case WM_MINMAXFRAME:
   if (((PSWP)mp1)->fs & SWP_MINIMIZE) {
      /* we're being minimized */
   } else {
      /* we're being maximized or restored */
   } /* endif */
   break;

Cheers,
Q - the "Q"uestor for knowledge (, a degree, etc.)

lsalomo@hubcap.clemson.edu
ibmman@clemson.clemson.edu
=============================================================================
"Gee Wally, I think there's something wrong with the Beaver."
=============================================================================