Xref: utzoo comp.os.os2.misc:355 comp.os.os2.programmer:245 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!emory!hubcap!lsalomo From: lsalomo@hubcap.clemson.edu (lsalomo) Newsgroups: comp.os.os2.misc,comp.os.os2.programmer Subject: Re: Help with setting the oicon for minimized window Message-ID: <11470@hubcap.clemson.edu> Date: 8 Nov 90 15:49:58 GMT References: <13005@asylum.SF.CA.US> Organization: Clemson University, Clemson, SC Lines: 58 Have you looked in Appendix B of the Tech Ref? The format for bitmaps, icons, and pointers is discussed there. An alternative way to do this, if I understand you correctly, is to draw the icon yourself once you realize you are being minimized. This is how the popular clock programs do it. If you'll notice, you need to subclass the frame IF THE WINDOW IS NOT A DIALOG BOX!!! If the window is a dialog box, cut the WM_PAINT from newFrameProc and paste it in your dialog proc. This is because dialog boxes are a cut-back subclassed frame. Notice that the frame sends a WM_MINMAXFRAME to the client telling it that it is being maximize, minimized, or restored. We could have intercepted it in newFrameProc, but I don't know how to do it that way. BOOL minimized; MRESULT EXPENTRY newFrameProc(HWND hwnd,USHORT msg,MPARAM mp1,MPARAM mp2) { switch (msg) { case WM_PAINT: if (minimized) { HPS hps; hps=WinBeginPaint(hwnd,NULL,NULL); /* Do your drawing here */ WinEndPaint(hps); return (MRESULT)FALSE; } /* endif */ break; default: break; } /* endswitch */ return (*oldFrameProc)(hwnd,msg,mp1,mp2); } MRESULT EXPENTRY myWinProc(HWND hwnd,USHORT msg,MPARAM mp1,MPARAM mp2) { switch (msg) { : : case WM_MINMAXFRAME: minimized=(((PSWP)mp1)->fs & SWP_MINIMIZE); break; : : default: return WinDefWindowProc(hwnd,msg,mp1,mp2); break; } /* endswitch */ return (MRESULT)FALSE; }