15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Title icon on Property Sheet

Mats Mеnhav -- manhav@connectum.skurup.se
Wednesday, October 16, 1996

-- [ From: Mats Manhav * EMC.Ver #2.5.02 ] --

Environment: MSVC 4.2b Win NT 4.0

Hi,

In a property sheet there is an icon at the right hand of the title bar.
I make the property sheet using CPropertySheet.
By default this is a Windows 95 logo. I want to change the icon.
But I cannot find out how to do it correctly. I saw in the documentation how
to do it, but I don't get it to work.
The class hierarchy is like the following.
CPropertySheet
       CBaseSheet
                CPersonSheet
                CDoorSheet

When I want to construct an object of type CPersonSheet I create the object
using the default ctor.
I make some initializations and call the CBaseSheet::Construct()
which looks like this:

void CBaseSheet::Construct(UINT nIDCaption, CWnd* pParentWnd, UINT
iSelectPage )
{
   m_FinishButtonState = PSWIZB_DISABLEDFINISH;
   CString Title, Base, Type; 
   Type.LoadString(nIDCaption);
   Base.LoadString(m_TitleId);
   Title = Base + " - <";
   Title += Type;
   Title += ">";
   
   CPropertySheet::Construct(Title, pParentWnd, iSelectPage);

   ///////
   //// 
   m_psh.dwFlags |= PSH_USEICONID;
   m_psh.pszIcon = MAKEINTRESOURCE(m_TitleIconId);
   // the m_TitleIconId is an UINT that has the value pointing to an Icon in
the resource file
   // the resource is a 16X16 Icon.
   ////
   //////
}
Can anyone give me a hint why this is not working ?

Mats
--
==========================================================================
Mats Mеnhav (Mats Manhav for 7-bit people)
email:manhav@connectum.skurup.se   WWW: http://connectum.skurup.se/~manhav
FAX:  (int) 46 (0) 414 243 05      Phone: (int) 46 (0) 414 243 05         
==========================================================================




Mario Contestabile -- Mario_Contestabile.UOS__MTL@UOSMTL2.universal.com
Friday, October 18, 1996

>   m_psh.pszIcon = MAKEINTRESOURCE(m_TitleIconId);
>   // the m_TitleIconId is an UINT that has the value pointing to an Icon i

I can't see what the problem is, but try the other union member,

- Set the PSH_USEHICON  style
- m_psh.hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);

mcontest@universal.com





| Вернуться в корень Архива |