[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [T-Merge patch] syncing code for views

From: Oto BREZINA <otik_at_printflow.eu>
Date: Wed, 11 May 2011 22:54:30 +0200

On 2011-04-17 11:46, Stefan Küng wrote:
> On 17.04.2011 09:30, Oto BREZINA wrote:
>> On 2011-04-05 20:03, Stefan Küng wrote:
>>>> 2. Is there plan to support icons there? let say, same like in main
>>>> menu? not worth much but nice :)
>>> Good idea.
>> I look at code it seems be possible without owner draw to keep string.
>> (ref: http://www.codeguru.com/forum/archive/index.php/t-101074.html)
>> However I don't know how to extract one bitmap from toolbar ...
>> Do we need set new resource?
> To get the icon for a specific command from the toolbar, something like
> this might work:
>
> HICON GetIconForCommand() {
> CToolbar bar;
> bar.Create(m_hWnd);
> if (bar.LoadToolBar(IDR_MAINFRAME))
> {
> int offset = bar.CommandToIndex(cmdId);
> CImageList imgList;
> imgList.Attach(SendMessage(bar.GetSafeHwnd(), TB_GETIMAGELIST, 0, 0));
> HICON h=imgList.ExtractIcon(offset);
> imgList.Detach();
> return h;
> }
> return 0;
> }
> If a handle is returned, use that for the AppendMenuIcon() method.
> Otherwise (if 0 is returned) you can use a custom icon.
I tried this and some other aproach as well. In best case I was able to
get some handle, but it wont display icon on popup menu. However when I
use some bitmap/icon from resource it works.
> Stefan
>

-- 
Oto BREZINA, Printflow s.r.o., EU
+421 903 653470 skype: ot_ik_
3D"My <3D%22skype:tomas.blaho?call%22><3D%22skype:tomas.blaho?call%22>
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2734492
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2011-05-11 22:54:50 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.