• <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>

            力為的技術博客

            聯系 聚合 管理
              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 力為 閱讀(2015) 評論(0)  編輯 收藏 引用 所屬分類: 6. COM&ATL&WTL
            久久精品国产亚洲Aⅴ蜜臀色欲| 久久婷婷色综合一区二区| 亚洲精品无码久久久久AV麻豆| 久久乐国产精品亚洲综合| 久久精品国产男包| 51久久夜色精品国产| 四虎久久影院| 欧美一区二区精品久久| 亚洲国产精品无码久久九九| 国产精品一久久香蕉产线看| 久久久久99精品成人片| 久久66热人妻偷产精品9| 久久精品成人免费国产片小草| 久久婷婷人人澡人人爽人人爱| 久久国产免费观看精品| 久久中文字幕精品| 久久精品人妻一区二区三区| 久久久久亚洲AV无码麻豆| 国产精品99久久久久久宅男小说| 91精品国产91久久综合| 久久精品一本到99热免费| 91久久精品国产91性色也| 少妇内射兰兰久久| 久久婷婷午色综合夜啪| 天堂无码久久综合东京热| 激情五月综合综合久久69| 丁香狠狠色婷婷久久综合| 久久久久久久97| 国产精品国色综合久久| 亚洲国产精品无码久久一区二区| 久久久久久国产a免费观看黄色大片 | 亚洲国产成人精品久久久国产成人一区二区三区综 | 国产精品久久免费| 中文精品久久久久人妻不卡| 欧美色综合久久久久久| 青青热久久国产久精品| 久久精品国产亚洲Aⅴ香蕉 | 理论片午午伦夜理片久久 | 久久久久99精品成人片| 久久久久久一区国产精品| 国产农村妇女毛片精品久久|