• <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 力為 閱讀(2017) 評論(0)  編輯 收藏 引用 所屬分類: 6. COM&ATL&WTL
            麻豆av久久av盛宴av| 久久夜色精品国产噜噜亚洲AV| 99久久国语露脸精品国产| 久久99精品国产麻豆宅宅| 99久久国产免费福利| 久久中文字幕人妻丝袜| 91精品国产综合久久婷婷| 亚洲国产精品综合久久网络| 婷婷五月深深久久精品| 亚洲欧美久久久久9999| 久久精品国产91久久综合麻豆自制| 四虎国产精品成人免费久久| 国产产无码乱码精品久久鸭| 亚洲欧美成人久久综合中文网| 久久精品国产一区| 久久人人爽爽爽人久久久| 久久天天婷婷五月俺也去| 精品久久久久久无码人妻热| 国产精品视频久久久| 免费久久人人爽人人爽av| 久久精品人妻一区二区三区| 国产精品久久久久久搜索| 婷婷久久香蕉五月综合加勒比| 性欧美大战久久久久久久| 久久久久久国产精品免费免费 | 性欧美丰满熟妇XXXX性久久久| 久久AAAA片一区二区| 久久黄视频| 精品久久久久久国产三级| 久久久久久国产精品美女 | 欧美黑人激情性久久| 精品久久久久久久国产潘金莲| 亚洲精品美女久久久久99小说 | 国内精品久久久久影院优| 久久99国内精品自在现线| 99久久99这里只有免费费精品| 久久久久久午夜成人影院| 女人香蕉久久**毛片精品| 国产精品日韩深夜福利久久 | 国内精品伊人久久久久777| 久久人人爽人人爽人人片AV麻烦|