🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #1606

Re: Minimize a dialog box, get an icon?

#1606
From: lsalomo
Date: Wed, 31 Oct 1990 17:38
49 lines
2293 bytes
From article <1990Oct30.223224.27196@morrow.stanford.edu>, by BR.JWF@forsythe.stanford.edu (Jay Field):
> Does anyone know how to associate an icon with a dialog box?
> The dialog box was created with the DLGBOX editor and I included
> a MINIMIZE button.  I have tried all combinations of FS_ICON
> and FCF_ICON and POINTER statements, but I still can't get
> the icon associated with the minimized dialog box.  Any ideas
> would be greatly appreciated.

Note that this has been fought over and over again by OS/2 users.  This was
answered by saying that a dialog box is NOT a frame and should NOT have support
for such items as a sizing border, an icon, etc.  If you want this, you have to
do it manually:

MRESULT EXPENTRY myDlgProc(HWND hwnd,USHORT msg,MPARAM mp1,MPARAM mp2)
{
   switch (msg) {
   case WM_INITDLG:
      {
         HPOINTER hIcon;
 
         /******************************
          Note that we don't have to check for NULL,
          because WinDefDlgProc processing for WM_SETICON
          will take care of it.
         ******************************/
         hIcon=WinLoadPointer(...);
         WinSendMsg(hwnd,WM_SETICON,MPFROMP(hIcon),0L);
      }
      break;
      :
   default:
      return WinDefDlgProc(hwnd,msg,mp1,mp2);
   } /* endswitch */

   return (MRESULT)FALSE;
}

I haven't tried doing this in a while (I have since gotten on the CUA kick in
a BIG way) so I'm not POSITIVE that the above code will work, but I think it
is correct (or extremely close to being correct).

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."
=============================================================================
Technical Details
Message-ID: <11282@hubcap.clemson.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!sol.ctr.columbia.edu!emory!hubcap!lsalomo
References: <1990Oct30.223224.27196@morrow.stanford.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!sol.ctr.columbia.edu!emory!hubcap!lsalomo
From: lsalomo@hubcap.clemson.edu (lsalomo)
Newsgroups: comp.os.os2.programmer
Subject: Re: Minimize a dialog box, get an icon?
Message-ID: <11282@hubcap.clemson.edu>
Date: 31 Oct 90 17:38:01 GMT
References: <1990Oct30.223224.27196@morrow.stanford.edu>
Organization: Clemson University, Clemson, SC
Lines: 49