• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            力為的技術(shù)博客

            聯(lián)系 聚合 管理
              154 Posts :: 1 Stories :: 561 Comments :: 0 Trackbacks

            It's said in MSDN that:“Microsoft Windows assumes that all of a toolbar's bitmapped images are the same size. ” So the question is : How can we implement a toolbar?with different sized images, which is just like as Google Toolbar?


            There are two ways:

            1.To use double ImageLists

            You should note that the image's size of the toolbar is decided by?the first ImageList, even though the second one is different from the first one. So after registering double ImageLists, you also have to reset the button's size to suit the second imagelist.
            This is the code segment:

            a. setting double imagelist
            ????//1st?ImageList, with normal images
            ????m_hImage1st?=?ImageList_Create(16,?16,?ILC_COLOR24,?1,?0);
            ????
            int?nIdx11?=?ImageList_Add(m_hImageFirst,,NULL);
            ????
            int?nIdx12?=??ImageList_Add(m_hImageFirst,,NULL);

            ????????
            //2nd?ImageList, with bigger image
            ????m_hImage2nd?=?ImageList_Create(48,?16,?ILC_COLOR24,?2,?0);
            ????
            int?nIdx21?=ImageList_Add(m_hImage2nd?,,NULL);

            ????
            //?add?imagelists, the order is very important
            ????::SendMessage(m_hWnd,?CCM_SETVERSION,?(WPARAM)?5,?0);
            ????::SendMessage(m_hWnd,?TB_SETIMAGELIST,?
            0,?(LPARAM)m_hImage1st);
            ????::SendMessage(m_hWnd,?TB_SETIMAGELIST,?
            1,?(LPARAM)m_hImage2nd);

            ????
            //?set?button?image
            ????pTBBtn[0].iBitmap?=?MAKELONG(nIdx21,?1);
            ????pTBBtn[
            1].iBitmap?=?MAKELONG(nIdx11,?0);
            ????pTBBtn[
            2].iBitmap?=?MAKELONG(nIdx12,?0);

            b. resize the button with bigger image
            ????TBBUTTONINFO?tbi;????????????
            ????tbi.cbSize?
            =?sizeof(TBBUTTONINFO);
            ????tbi.dwMask?
            =?TBIF_STYLE?|?TBIF_SIZE;
            ????tbi.fsStyle?
            =?pTBBtn[0].fsStyle;
            ????tbi.cx?
            =?48;
            ????????::SendMessage(m_hWnd,?TB_SETBUTTONINFO,?nID,?(LPARAM)
            &tbi);

            And now, ?the first button of the toolbar has different sized image from others.

            2. To use Rebar control

            A rebar?control?may have many toolbars, so you can create two toolbars with different sized imagelist.(See MSDN.). But we can only create one toolbar in WTL by default, so it's a little complex to implement?using WTL in this method. You can try?this?in MFC.
            posted on 2006-06-11 15:39 力為 閱讀(2011) 評論(0)  編輯 收藏 引用 所屬分類: 6. COM&ATL&WTL
            久久精品九九亚洲精品| 亚洲精品乱码久久久久久蜜桃不卡| 男女久久久国产一区二区三区| 亚洲国产精品久久久天堂| 国内精品伊人久久久久av一坑| 日韩精品国产自在久久现线拍| 国产免费久久久久久无码| 伊人久久大香线蕉无码麻豆| 91精品国产综合久久四虎久久无码一级| 久久97久久97精品免视看| 久久久久99这里有精品10| 国产精品对白刺激久久久| 老司机午夜网站国内精品久久久久久久久| 精品多毛少妇人妻AV免费久久| 国产精品久久久天天影视| 人妻无码精品久久亚瑟影视| 久久狠狠高潮亚洲精品| 大香伊人久久精品一区二区| 久久精品国产福利国产秒| 国产美女亚洲精品久久久综合| 久久久精品免费国产四虎| 国产aⅴ激情无码久久| 久久久精品久久久久特色影视| 久久久久国产精品熟女影院| 青青草原综合久久大伊人| 精品久久综合1区2区3区激情| 久久99精品久久久久久hb无码| 一本一本久久a久久精品综合麻豆| 国产精品久久久久9999| 久久亚洲私人国产精品vA| 久久久国产精华液| 亚洲国产成人久久精品99 | 久久99精品国产99久久| 亚洲级αV无码毛片久久精品| 亚洲精品乱码久久久久久蜜桃| 久久国产精品波多野结衣AV| 香蕉久久一区二区不卡无毒影院| 99久久精品国产免看国产一区| 久久亚洲精品人成综合网| 亚洲午夜久久久久久久久久| 日韩人妻无码精品久久免费一 |