<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Toolbar, tooltip&#x2F;disable]]></title><description><![CDATA[<p>Hallo!<br />
ich habe eine klasse geschrieben zum erzeugen einer toolbar...</p>
<pre><code class="language-cpp">#include &lt;commctrl.h&gt;
#include &lt;windows.h&gt;

class Toolbar
{
	public:
		Toolbar(HINSTANCE instance, HWND hwnd, int style);
		~Toolbar();
		void addButton( int command, char* filename, int style=TBSTYLE_BUTTON);
		void addStandardButton( int command, int std_ID, int style=TBSTYLE_BUTTON);
		void addSeparator();

	private:
		HINSTANCE hInst;
		HWND hwnd;
};

Toolbar::Toolbar(HINSTANCE instance, HWND hwnd, int style)
{
	hInst = instance;
	Toolbar::hwnd= CreateWindowEx(  0,
									TOOLBARCLASSNAME,
									(LPSTR) NULL,
									WS_CHILD | style,
									0, 0, 0, 0,
									hwnd,
									(HMENU) 1,
									instance,
									NULL
                                );
	TBADDBITMAP bitid;
    bitid.hInst = HINST_COMMCTRL;
    bitid.nID = IDB_STD_SMALL_COLOR;
	SendMessage(Toolbar::hwnd, TB_ADDBITMAP, 1, (long)&amp;bitid);

	SendMessage(Toolbar::hwnd, TB_BUTTONSTRUCTSIZE, (WPARAM) sizeof(TBBUTTON), 0);       //Backward compatiblity
	ShowWindow(Toolbar::hwnd, SW_SHOW);  //Show Toolbar!
}

void Toolbar::addButton(int command, char* filename, int style)
{
	HBITMAP h_bitmap;
    h_bitmap = (HBITMAP)LoadImage(  NULL,
                                    filename,      // name or identifier of image
                                    IMAGE_BITMAP,          // type of image
                                    16,                      // desired width
                                    16,                      // desired height
                                    LR_LOADFROMFILE          // load flags
                                 );

    //fill ADDBITMAP-Structur and overgive Bitmap-Handle
    TBADDBITMAP bitid;
    bitid.hInst = NULL;
    bitid.nID = (UINT)h_bitmap;

    TBBUTTON tbbutton;      //Create TBBUTTON-Structur for saving infos about button which is to add
    tbbutton.iBitmap = SendMessage(hwnd, TB_ADDBITMAP, 1, (long)&amp;bitid);  
    tbbutton.idCommand = command;       //Command-Parameter to Command-Message to recognize clicks on Toolbar-Button
    tbbutton.fsState = TBSTATE_ENABLED;
    tbbutton.fsStyle = style;
    tbbutton.dwData = 0;
    tbbutton.iString = NULL;

    //At last, add the button to the Toolbar
    SendMessage(hwnd, TB_ADDBUTTONS, (WPARAM) 1, (LPARAM) (LPTBBUTTON) &amp;tbbutton);
}

void Toolbar::addSeparator()
{
	TBBUTTON tbbutton;      //Create TBBUTTON-Structur for saving infos about button which is to add
    tbbutton.iBitmap = NULL;  
    tbbutton.idCommand = NULL;       //Command-Parameter to Command-Message to recognize clicks on Toolbar-Button
    tbbutton.fsState = NULL;
    tbbutton.fsStyle = TBSTYLE_SEP;
    tbbutton.dwData = NULL;
    tbbutton.iString = NULL;

    SendMessage(hwnd, TB_ADDBUTTONS, (WPARAM) 1, (LPARAM) (LPTBBUTTON) &amp;tbbutton);
}

void Toolbar::addStandardButton(int command, int std_ID,int style)
{
	TBBUTTON tbbutton;      //Create TBBUTTON-Structur for saving infos about button which is to add
    tbbutton.iBitmap = std_ID;
    tbbutton.idCommand = command;       //Command-Parameter to Command-Message to recognize clicks on Toolbar-Button
    tbbutton.fsState = TBSTATE_ENABLED;
    tbbutton.fsStyle = style;
    tbbutton.dwData = 0;
    tbbutton.iString = NULL;
    SendMessage(hwnd, TB_ADDBUTTONS, (WPARAM) 1, (LPARAM) (LPTBBUTTON) &amp;tbbutton); 
}
</code></pre>
<p>jetzt will ich irgendwie zu den buttons noch einen Tooltip hinzufügen, bzw buttons enablen, disablen können hab aber kA, wie ich das anstellen soll...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/219709/toolbar-tooltip-disable</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 07:25:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/219709.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 06 Aug 2008 15:57:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Toolbar, tooltip&#x2F;disable on Wed, 06 Aug 2008 15:57:08 GMT]]></title><description><![CDATA[<p>Hallo!<br />
ich habe eine klasse geschrieben zum erzeugen einer toolbar...</p>
<pre><code class="language-cpp">#include &lt;commctrl.h&gt;
#include &lt;windows.h&gt;

class Toolbar
{
	public:
		Toolbar(HINSTANCE instance, HWND hwnd, int style);
		~Toolbar();
		void addButton( int command, char* filename, int style=TBSTYLE_BUTTON);
		void addStandardButton( int command, int std_ID, int style=TBSTYLE_BUTTON);
		void addSeparator();

	private:
		HINSTANCE hInst;
		HWND hwnd;
};

Toolbar::Toolbar(HINSTANCE instance, HWND hwnd, int style)
{
	hInst = instance;
	Toolbar::hwnd= CreateWindowEx(  0,
									TOOLBARCLASSNAME,
									(LPSTR) NULL,
									WS_CHILD | style,
									0, 0, 0, 0,
									hwnd,
									(HMENU) 1,
									instance,
									NULL
                                );
	TBADDBITMAP bitid;
    bitid.hInst = HINST_COMMCTRL;
    bitid.nID = IDB_STD_SMALL_COLOR;
	SendMessage(Toolbar::hwnd, TB_ADDBITMAP, 1, (long)&amp;bitid);

	SendMessage(Toolbar::hwnd, TB_BUTTONSTRUCTSIZE, (WPARAM) sizeof(TBBUTTON), 0);       //Backward compatiblity
	ShowWindow(Toolbar::hwnd, SW_SHOW);  //Show Toolbar!
}

void Toolbar::addButton(int command, char* filename, int style)
{
	HBITMAP h_bitmap;
    h_bitmap = (HBITMAP)LoadImage(  NULL,
                                    filename,      // name or identifier of image
                                    IMAGE_BITMAP,          // type of image
                                    16,                      // desired width
                                    16,                      // desired height
                                    LR_LOADFROMFILE          // load flags
                                 );

    //fill ADDBITMAP-Structur and overgive Bitmap-Handle
    TBADDBITMAP bitid;
    bitid.hInst = NULL;
    bitid.nID = (UINT)h_bitmap;

    TBBUTTON tbbutton;      //Create TBBUTTON-Structur for saving infos about button which is to add
    tbbutton.iBitmap = SendMessage(hwnd, TB_ADDBITMAP, 1, (long)&amp;bitid);  
    tbbutton.idCommand = command;       //Command-Parameter to Command-Message to recognize clicks on Toolbar-Button
    tbbutton.fsState = TBSTATE_ENABLED;
    tbbutton.fsStyle = style;
    tbbutton.dwData = 0;
    tbbutton.iString = NULL;

    //At last, add the button to the Toolbar
    SendMessage(hwnd, TB_ADDBUTTONS, (WPARAM) 1, (LPARAM) (LPTBBUTTON) &amp;tbbutton);
}

void Toolbar::addSeparator()
{
	TBBUTTON tbbutton;      //Create TBBUTTON-Structur for saving infos about button which is to add
    tbbutton.iBitmap = NULL;  
    tbbutton.idCommand = NULL;       //Command-Parameter to Command-Message to recognize clicks on Toolbar-Button
    tbbutton.fsState = NULL;
    tbbutton.fsStyle = TBSTYLE_SEP;
    tbbutton.dwData = NULL;
    tbbutton.iString = NULL;

    SendMessage(hwnd, TB_ADDBUTTONS, (WPARAM) 1, (LPARAM) (LPTBBUTTON) &amp;tbbutton);
}

void Toolbar::addStandardButton(int command, int std_ID,int style)
{
	TBBUTTON tbbutton;      //Create TBBUTTON-Structur for saving infos about button which is to add
    tbbutton.iBitmap = std_ID;
    tbbutton.idCommand = command;       //Command-Parameter to Command-Message to recognize clicks on Toolbar-Button
    tbbutton.fsState = TBSTATE_ENABLED;
    tbbutton.fsStyle = style;
    tbbutton.dwData = 0;
    tbbutton.iString = NULL;
    SendMessage(hwnd, TB_ADDBUTTONS, (WPARAM) 1, (LPARAM) (LPTBBUTTON) &amp;tbbutton); 
}
</code></pre>
<p>jetzt will ich irgendwie zu den buttons noch einen Tooltip hinzufügen, bzw buttons enablen, disablen können hab aber kA, wie ich das anstellen soll...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1560335</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1560335</guid><dc:creator><![CDATA[spong3bob]]></dc:creator><pubDate>Wed, 06 Aug 2008 15:57:08 GMT</pubDate></item><item><title><![CDATA[Reply to Toolbar, tooltip&#x2F;disable on Wed, 06 Aug 2008 16:13:19 GMT]]></title><description><![CDATA[<p><a href="http://msdn.microsoft.com/en-us/library/bb760252(VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb760252(VS.85).aspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1560344</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1560344</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 06 Aug 2008 16:13:19 GMT</pubDate></item><item><title><![CDATA[Reply to Toolbar, tooltip&#x2F;disable on Wed, 06 Aug 2008 16:22:23 GMT]]></title><description><![CDATA[<p>Also die Tooltips von Hand per eigenem Tooltipfenster erzeugen ist schon etwas Aufwand, die einfachste Methode ist über den Resourceneditor falls du VS benutzt. Desweiteren kannst du die Buttenstates (und noch einiges mehr) mit dem Befehl <strong>TB_SETBUTTONINFO</strong> setzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1560348</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1560348</guid><dc:creator><![CDATA[your personal tooltip]]></dc:creator><pubDate>Wed, 06 Aug 2008 16:22:23 GMT</pubDate></item><item><title><![CDATA[Reply to Toolbar, tooltip&#x2F;disable on Wed, 06 Aug 2008 17:18:57 GMT]]></title><description><![CDATA[<p>hmm... hab mich da a bissl gespielt, aber da is nie was sinnvolles rausgekommen.. wie würd das denn in meinem beispiel ausschauen, wenn ich in der addButton noch einen parameter char* tooltip drin hab und will, dass der dann beim button aufscheint?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1560373</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1560373</guid><dc:creator><![CDATA[spong3bob]]></dc:creator><pubDate>Wed, 06 Aug 2008 17:18:57 GMT</pubDate></item><item><title><![CDATA[Reply to Toolbar, tooltip&#x2F;disable on Wed, 06 Aug 2008 17:40:48 GMT]]></title><description><![CDATA[<p>Das kann ich dir jetzt nicht sagen wie man das unter c++ implementiert, da ich nur winapi+c kann. Aber die Tooltips sind definitiv ein eigenes Fenster und werden mit <strong>TTM_ADDTOOL</strong> einem anderen Fenster zugewiesen für das Tolltips angezeigt werden sollen. In deinem Fall die Tollbar. Die Toolbar musst du subclasen und die Events <strong>WM_MOUSELEAVE</strong> und <strong>WM_MOUSEMOVE</strong> auswerten, d.h. bei <strong>WM_MOUSEMOVE</strong> per Hittest schauen was sich unter dem Mauscursur befindet und entsprechen dem Button den Tooltiptext mit <strong>TTM_UPDATETIPTEXT</strong> anzeigen. Das war mal ganz grob erklärt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1560385</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1560385</guid><dc:creator><![CDATA[your personal tooltip]]></dc:creator><pubDate>Wed, 06 Aug 2008 17:40:48 GMT</pubDate></item><item><title><![CDATA[Reply to Toolbar, tooltip&#x2F;disable on Wed, 06 Aug 2008 18:33:05 GMT]]></title><description><![CDATA[<p>In der Hoffnung dass es doch mit TB_SETBUTTONINFO funktioniert hab ich mal herumprobiert..<br />
es funktioniert aber nicht :((</p>
<pre><code class="language-cpp">void addTooltip(HWND hwnd, char* tooltip, int id)
{
	TBBUTTONINFO info;
	info.cbSize = sizeof(info);
	info.dwMask = TBIF_TEXT;
	info.pszText = tooltip;
	int i=SendMessage(hwnd, TB_SETBUTTONINFO, id,(LPARAM)&amp;info);
	if(i&lt;=0)
		MessageBox ( NULL, &quot;FALSCH&quot;, &quot;Mein erstet Windowsprogramm!&quot;, MB_OK);
	else
		MessageBox ( NULL, &quot;RICHTIG&quot;, &quot;Mein erstet Windowsprogramm!&quot;, MB_OK);
}
</code></pre>
<p>es kommt auch immer falsch raus...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1560412</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1560412</guid><dc:creator><![CDATA[spong3bob]]></dc:creator><pubDate>Wed, 06 Aug 2008 18:33:05 GMT</pubDate></item><item><title><![CDATA[Reply to Toolbar, tooltip&#x2F;disable on Wed, 06 Aug 2008 19:59:50 GMT]]></title><description><![CDATA[<p>Ich vermnte mal, daß du bei <strong>hwnd</strong> den Handle deines Hauptfensters oder irgendeinen andern Handle übegibst, aber nicht den Handle der Toolbar.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1560454</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1560454</guid><dc:creator><![CDATA[your personal tooltip]]></dc:creator><pubDate>Wed, 06 Aug 2008 19:59:50 GMT</pubDate></item><item><title><![CDATA[Reply to Toolbar, tooltip&#x2F;disable on Wed, 06 Aug 2008 20:17:52 GMT]]></title><description><![CDATA[<p>nein, das is der handle zur toolbar... ich weiß nur bei der id nicht, was da hingehört..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1560464</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1560464</guid><dc:creator><![CDATA[spong3bob]]></dc:creator><pubDate>Wed, 06 Aug 2008 20:17:52 GMT</pubDate></item></channel></rss>