• <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
            久久99热狠狠色精品一区| 久久综合九色综合欧美就去吻| 亚洲国产精品一区二区三区久久 | 日韩电影久久久被窝网| 一本久久精品一区二区| 无码国内精品久久综合88| 青草国产精品久久久久久 | 国产美女久久久| 欧美久久久久久午夜精品| 99久久99久久精品国产片果冻| 久久91亚洲人成电影网站| 久久久无码精品亚洲日韩软件| 久久人人爽人人人人爽AV| 一本大道久久a久久精品综合| 久久久久久久波多野结衣高潮 | 99国产精品久久久久久久成人热| 国产精品久久久久一区二区三区| 欧美日韩久久中文字幕| 美女写真久久影院| 亚洲va国产va天堂va久久| 777久久精品一区二区三区无码| 亚洲天堂久久久| 久久久久久青草大香综合精品| 无码伊人66久久大杳蕉网站谷歌 | 久久久人妻精品无码一区| 69久久夜色精品国产69| 国产精品美女久久福利网站| 99久久人妻无码精品系列蜜桃| 国产精品久久久久久久app| 国内精品久久久久久久久| 久久99久久99小草精品免视看| 久久综合给合久久狠狠狠97色| 欧美一级久久久久久久大| 曰曰摸天天摸人人看久久久| 97久久超碰国产精品旧版| 国内精品久久久久影院优| 久久伊人精品一区二区三区| 欧美性猛交xxxx免费看久久久| 久久综合久久性久99毛片| 久久夜色精品国产www| 日产久久强奸免费的看|