<?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[Schaltfläche in Symbolleiste zur Laufzeit einfügen]]></title><description><![CDATA[<p>Hallo,Forum! Jetzt stell ich mal wieder eine Frage zu folgendem Programm:</p>
<pre><code class="language-cpp">#define STRICT
#include &lt;windows.h&gt;
#include &lt;commctrl.h&gt;
#include &quot;Symbolleiste_2.h&quot;

const int NumButtons = 3;
HWND hToolBar;

LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
const char szAppName[] = &quot;Symbolleiste&quot;;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
	HWND hWnd;
   MSG  msg;
   HMENU hMenu;
   WNDCLASSEX wc;

   wc.cbSize			= sizeof(WNDCLASSEX);
   wc.style				= CS_HREDRAW|CS_VREDRAW;
   wc.lpfnWndProc		= WndProc;
   wc.cbClsExtra		= 0;
   wc.cbWndExtra		= 0;
   wc.hInstance		= hInstance;
   wc.hCursor			= LoadCursor(NULL, IDC_CROSS);
   wc.hIcon				= LoadIcon(NULL, IDI_APPLICATION);
   wc.hbrBackground	= (HBRUSH)(COLOR_INACTIVECAPTION);
   wc.lpszClassName	= szAppName;
   wc.lpszMenuName	= NULL;
   wc.hIconSm			= (HICON)LoadImage(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_ICON1),
   							IMAGE_ICON, 16, 16, 0);

   if (RegisterClassEx(&amp;wc) == 0)
   	return 0;
   hMenu = LoadMenu(hInstance, MAKEINTRESOURCE(IDM_MENU1));
   hWnd = CreateWindowEx(NULL,
   								szAppName,
                           szAppName,
                           WS_OVERLAPPEDWINDOW|WS_VISIBLE,
                           CW_USEDEFAULT,
                           CW_USEDEFAULT,
                           400,
                           400,
                           NULL,
                           hMenu,
                           hInstance,
                           NULL);

   InitCommonControls ();
   TBBUTTON ToolButton[3];

   ToolButton[0].iBitmap 	= 0;
   ToolButton[0].idCommand = IDM_TB_EXIT;
   ToolButton[0].fsState	= TBSTATE_ENABLED;
   ToolButton[0].fsStyle	= TBSTYLE_BUTTON;
   ToolButton[0].dwData		= 0;
   ToolButton[0].iString	= 0;

   ToolButton[1].iBitmap 	= 1;
   ToolButton[1].idCommand = IDM_TB_HIDESHOW;
   ToolButton[1].fsState	= TBSTATE_ENABLED;
   ToolButton[1].fsStyle	= TBSTYLE_CHECK;
   ToolButton[1].dwData		= 0;
   ToolButton[1].iString	= 0;

   ToolButton[2].iBitmap 	= IDB_BITMAP2;
   ToolButton[2].idCommand = IDM_TB_SHOW;
   ToolButton[2].fsState	= TBSTATE_ENABLED;
   ToolButton[2].fsStyle	= TBSTYLE_BUTTON;
   ToolButton[2].dwData		= 0;
   ToolButton[2].iString	= 0;

   void tb_add_button(HWND, int, char*, int style);//Muß diese Funktionsdefinition an eine andere Stelle?

   hToolBar = CreateToolbarEx(hWnd,
   									WS_VISIBLE|WS_CHILD,3,NumButtons,
                              hInstance,IDB_BITMAP1,ToolButton, NumButtons, 16,16,16,16,
                              sizeof(TBBUTTON));

   ShowWindow (hWnd, iCmdShow);	
   UpdateWindow (hWnd);				
	while (GetMessage(&amp;msg, NULL,0,0))	
   {
      TranslateMessage(&amp;msg);	//Nachrichtenschleife
      DispatchMessage(&amp;msg);
   }
	return msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
//WndProc bearbeitet alle Nachrichten, die für diese Fensterklasse bestimmt sind.
{
   switch (message)
   {
      case WM_COMMAND:
      {
      	switch (LOWORD(wParam))
         {

          //Hier kommt noch ein Haufen Code, der auch funktioniert :+1: 

            case IDM_TB_SHOW:
            {
            	tb_add_button(hToolBar, 1, IDB_BITMAP2, TBSTYLE_CHECK);
               break;
            }

         }
         break;
      }

   	case WM_DESTROY:
      {
      	PostQuitMessage (0);	//Beendung der Anwendung
         return 0;
      }
   }
   return DefWindowProc(hwnd, message, wParam, lParam); 	//DefaultWindowProcedure, Standardbearbeitung.

}
////////////////////////////////////////////////////////////////////////////////////////

void tb_add_button(HWND hToolBar, int command, char* bitmap, int style = TBSTYLE_BUTTON)
{
	HBITMAP h_Bitmap;
   h_Bitmap = LoadBitmap(NULL, MAKEINTRESOURCE(IDB_BITMAP2));

   TBADDBITMAP bitid;
   bitid.hInst = GetModuleHandle(NULL);
   bitid.nID = (UINT)h_Bitmap;

   TBBUTTON newbutton;
   newbutton.iBitmap = SendMessage(hToolBar, TB_ADDBITMAP, 1, (long)&amp;bitid);
   newbutton.idCommand = command;
   newbutton.fsState = TBSTATE_ENABLED;
   newbutton.fsStyle = style;
   newbutton.dwData = 0;
   newbutton.iString = NULL;
   SendMessage(hToolBar, TB_ADDBUTTONS, (WPARAM)1, (LPARAM)(LPTBBUTTON)&amp;newbutton);
}
</code></pre>
<p>Wie man sieht, versuche ich, eine Schaltfläche zur Laufzeit in eine Symbolleiste einzufügen, wenn IDM_TB_SHOW gedrückt wird (auch ein Knopf in der Symbolleiste). Dazu dient die Funktion &quot;void tb_add_button&quot;.<br />
Das Problem: Wenn ich das Prog kompiliere, erhalte ich die Meldung &quot;call to undefined function tb_add_button&quot;. Dabei ist die Funktion in WinMain definiert.<br />
Wenn ich sie vor WinMain global definiere, kommen andere Fehlermeldungen, unter anderem, weil InitCommonControls noch nicht ausgeführt wurde (die Parameter davon werden ja in der Funktion gebraucht) oder weil der dritte Parameter (char*) nicht convertiert werden kann.<br />
Vielleicht habe ich aber auch einen falschen Ansatz?<br />
Was muß ich da ändern?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/159530/schaltfläche-in-symbolleiste-zur-laufzeit-einfügen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Jul 2026 13:38:47 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/159530.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 16 Sep 2006 09:40:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Schaltfläche in Symbolleiste zur Laufzeit einfügen on Sat, 16 Sep 2006 09:48:31 GMT]]></title><description><![CDATA[<p>Hallo,Forum! Jetzt stell ich mal wieder eine Frage zu folgendem Programm:</p>
<pre><code class="language-cpp">#define STRICT
#include &lt;windows.h&gt;
#include &lt;commctrl.h&gt;
#include &quot;Symbolleiste_2.h&quot;

const int NumButtons = 3;
HWND hToolBar;

LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
const char szAppName[] = &quot;Symbolleiste&quot;;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
	HWND hWnd;
   MSG  msg;
   HMENU hMenu;
   WNDCLASSEX wc;

   wc.cbSize			= sizeof(WNDCLASSEX);
   wc.style				= CS_HREDRAW|CS_VREDRAW;
   wc.lpfnWndProc		= WndProc;
   wc.cbClsExtra		= 0;
   wc.cbWndExtra		= 0;
   wc.hInstance		= hInstance;
   wc.hCursor			= LoadCursor(NULL, IDC_CROSS);
   wc.hIcon				= LoadIcon(NULL, IDI_APPLICATION);
   wc.hbrBackground	= (HBRUSH)(COLOR_INACTIVECAPTION);
   wc.lpszClassName	= szAppName;
   wc.lpszMenuName	= NULL;
   wc.hIconSm			= (HICON)LoadImage(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_ICON1),
   							IMAGE_ICON, 16, 16, 0);

   if (RegisterClassEx(&amp;wc) == 0)
   	return 0;
   hMenu = LoadMenu(hInstance, MAKEINTRESOURCE(IDM_MENU1));
   hWnd = CreateWindowEx(NULL,
   								szAppName,
                           szAppName,
                           WS_OVERLAPPEDWINDOW|WS_VISIBLE,
                           CW_USEDEFAULT,
                           CW_USEDEFAULT,
                           400,
                           400,
                           NULL,
                           hMenu,
                           hInstance,
                           NULL);

   InitCommonControls ();
   TBBUTTON ToolButton[3];

   ToolButton[0].iBitmap 	= 0;
   ToolButton[0].idCommand = IDM_TB_EXIT;
   ToolButton[0].fsState	= TBSTATE_ENABLED;
   ToolButton[0].fsStyle	= TBSTYLE_BUTTON;
   ToolButton[0].dwData		= 0;
   ToolButton[0].iString	= 0;

   ToolButton[1].iBitmap 	= 1;
   ToolButton[1].idCommand = IDM_TB_HIDESHOW;
   ToolButton[1].fsState	= TBSTATE_ENABLED;
   ToolButton[1].fsStyle	= TBSTYLE_CHECK;
   ToolButton[1].dwData		= 0;
   ToolButton[1].iString	= 0;

   ToolButton[2].iBitmap 	= IDB_BITMAP2;
   ToolButton[2].idCommand = IDM_TB_SHOW;
   ToolButton[2].fsState	= TBSTATE_ENABLED;
   ToolButton[2].fsStyle	= TBSTYLE_BUTTON;
   ToolButton[2].dwData		= 0;
   ToolButton[2].iString	= 0;

   void tb_add_button(HWND, int, char*, int style);//Muß diese Funktionsdefinition an eine andere Stelle?

   hToolBar = CreateToolbarEx(hWnd,
   									WS_VISIBLE|WS_CHILD,3,NumButtons,
                              hInstance,IDB_BITMAP1,ToolButton, NumButtons, 16,16,16,16,
                              sizeof(TBBUTTON));

   ShowWindow (hWnd, iCmdShow);	
   UpdateWindow (hWnd);				
	while (GetMessage(&amp;msg, NULL,0,0))	
   {
      TranslateMessage(&amp;msg);	//Nachrichtenschleife
      DispatchMessage(&amp;msg);
   }
	return msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
//WndProc bearbeitet alle Nachrichten, die für diese Fensterklasse bestimmt sind.
{
   switch (message)
   {
      case WM_COMMAND:
      {
      	switch (LOWORD(wParam))
         {

          //Hier kommt noch ein Haufen Code, der auch funktioniert :+1: 

            case IDM_TB_SHOW:
            {
            	tb_add_button(hToolBar, 1, IDB_BITMAP2, TBSTYLE_CHECK);
               break;
            }

         }
         break;
      }

   	case WM_DESTROY:
      {
      	PostQuitMessage (0);	//Beendung der Anwendung
         return 0;
      }
   }
   return DefWindowProc(hwnd, message, wParam, lParam); 	//DefaultWindowProcedure, Standardbearbeitung.

}
////////////////////////////////////////////////////////////////////////////////////////

void tb_add_button(HWND hToolBar, int command, char* bitmap, int style = TBSTYLE_BUTTON)
{
	HBITMAP h_Bitmap;
   h_Bitmap = LoadBitmap(NULL, MAKEINTRESOURCE(IDB_BITMAP2));

   TBADDBITMAP bitid;
   bitid.hInst = GetModuleHandle(NULL);
   bitid.nID = (UINT)h_Bitmap;

   TBBUTTON newbutton;
   newbutton.iBitmap = SendMessage(hToolBar, TB_ADDBITMAP, 1, (long)&amp;bitid);
   newbutton.idCommand = command;
   newbutton.fsState = TBSTATE_ENABLED;
   newbutton.fsStyle = style;
   newbutton.dwData = 0;
   newbutton.iString = NULL;
   SendMessage(hToolBar, TB_ADDBUTTONS, (WPARAM)1, (LPARAM)(LPTBBUTTON)&amp;newbutton);
}
</code></pre>
<p>Wie man sieht, versuche ich, eine Schaltfläche zur Laufzeit in eine Symbolleiste einzufügen, wenn IDM_TB_SHOW gedrückt wird (auch ein Knopf in der Symbolleiste). Dazu dient die Funktion &quot;void tb_add_button&quot;.<br />
Das Problem: Wenn ich das Prog kompiliere, erhalte ich die Meldung &quot;call to undefined function tb_add_button&quot;. Dabei ist die Funktion in WinMain definiert.<br />
Wenn ich sie vor WinMain global definiere, kommen andere Fehlermeldungen, unter anderem, weil InitCommonControls noch nicht ausgeführt wurde (die Parameter davon werden ja in der Funktion gebraucht) oder weil der dritte Parameter (char*) nicht convertiert werden kann.<br />
Vielleicht habe ich aber auch einen falschen Ansatz?<br />
Was muß ich da ändern?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1138346</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1138346</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Sat, 16 Sep 2006 09:48:31 GMT</pubDate></item><item><title><![CDATA[Reply to Schaltfläche in Symbolleiste zur Laufzeit einfügen on Sat, 16 Sep 2006 14:28:18 GMT]]></title><description><![CDATA[<p>Elektronix schrieb:</p>
<blockquote>
<pre><code class="language-cpp">void tb_add_button(HWND, int, char*, int style);//Muß diese Funktionsdefinition an eine andere Stelle?
</code></pre>
</blockquote>
<p>Das ist keine Funktionsdefinition, sondern eine Deklaration <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> . Diese sind und müssen <em>IMMER</em> im <strong>global</strong>en Scope lieben.</p>
<p>Elektronix schrieb:</p>
<blockquote>
<p>Dabei ist die Funktion in WinMain definiert.</p>
</blockquote>
<p>Nö sie ist global definiert. Anders gehts auch nicht. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1138538</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1138538</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Sat, 16 Sep 2006 14:28:18 GMT</pubDate></item><item><title><![CDATA[Reply to Schaltfläche in Symbolleiste zur Laufzeit einfügen on Mon, 18 Sep 2006 07:18:10 GMT]]></title><description><![CDATA[<p>CodeFinder schrieb:</p>
<blockquote>
<p>Diese sind und müssen <em>IMMER</em> im <strong>global</strong>en Scope lieben.</p>
</blockquote>
<p>Lieben? Liegen? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
<p>Ok, werde das mal ändern, mal schauen, was geht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1139343</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1139343</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Mon, 18 Sep 2006 07:18:10 GMT</pubDate></item><item><title><![CDATA[Reply to Schaltfläche in Symbolleiste zur Laufzeit einfügen on Mon, 18 Sep 2006 12:48:39 GMT]]></title><description><![CDATA[<p>Ups <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> ... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1139562</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1139562</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Mon, 18 Sep 2006 12:48:39 GMT</pubDate></item><item><title><![CDATA[Reply to Schaltfläche in Symbolleiste zur Laufzeit einfügen on Mon, 18 Sep 2006 19:33:08 GMT]]></title><description><![CDATA[<p>So, mein Code sieht jetzt so aus:</p>
<pre><code class="language-cpp">#define STRICT
#include &lt;windows.h&gt;
#include &lt;commctrl.h&gt;
#include &quot;Symbolleiste_2.h&quot;

const int NumButtons = 3;
HWND hToolBar;
void tb_add_button(HWND, int, int, int style);
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
const char szAppName[] = &quot;Symbolleiste&quot;;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
	HWND hWnd;
   MSG  msg;
   HMENU hMenu;
   WNDCLASSEX wc;

   wc.cbSize			= sizeof(WNDCLASSEX);
   wc.style				= CS_HREDRAW|CS_VREDRAW;
   wc.lpfnWndProc		= WndProc;
   wc.cbClsExtra		= 0;
   wc.cbWndExtra		= 0;
   wc.hInstance		= hInstance;
   wc.hCursor			= LoadCursor(NULL, IDC_CROSS);
   wc.hIcon				= LoadIcon(NULL, IDI_APPLICATION);
   wc.hbrBackground	= (HBRUSH)(COLOR_INACTIVECAPTION);
   wc.lpszClassName	= szAppName;
   wc.lpszMenuName	= NULL;
   wc.hIconSm			= (HICON)LoadImage(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_ICON1),
   							IMAGE_ICON, 16, 16, 0);

   if (RegisterClassEx(&amp;wc) == 0)
   	return 0;
   hMenu = LoadMenu(hInstance, MAKEINTRESOURCE(IDM_MENU1));
   hWnd = CreateWindowEx(NULL,
   								szAppName,
                           szAppName,
                           WS_OVERLAPPEDWINDOW|WS_VISIBLE,
                           CW_USEDEFAULT,
                           CW_USEDEFAULT,
                           400,
                           400,
                           NULL,
                           hMenu,
                           hInstance,
                           NULL);

   InitCommonControls ();
   TBBUTTON ToolButton[3];

   ToolButton[0].iBitmap 	= 0;
   ToolButton[0].idCommand = IDM_TB_EXIT;
   ToolButton[0].fsState	= TBSTATE_ENABLED;
   ToolButton[0].fsStyle	= TBSTYLE_BUTTON;
   ToolButton[0].dwData		= 0;
   ToolButton[0].iString	= 0;

   ToolButton[1].iBitmap 	= 1;
   ToolButton[1].idCommand = IDM_TB_HIDESHOW;
   ToolButton[1].fsState	= TBSTATE_ENABLED;
   ToolButton[1].fsStyle	= TBSTYLE_CHECK;
   ToolButton[1].dwData		= 0;
   ToolButton[1].iString	= 0;

   ToolButton[2].iBitmap 	= IDB_BITMAP2;
   ToolButton[2].idCommand = IDM_TB_SHOW;
   ToolButton[2].fsState	= TBSTATE_ENABLED;
   ToolButton[2].fsStyle	= TBSTYLE_BUTTON;
   ToolButton[2].dwData		= 0;
   ToolButton[2].iString	= 0;

   hToolBar = CreateToolbarEx(hWnd,
   									WS_VISIBLE|WS_CHILD,3,NumButtons,
                              hInstance,IDB_BITMAP1,ToolButton, NumButtons, 16,16,16,16,
                              sizeof(TBBUTTON));

   ShowWindow (hWnd, iCmdShow);	
   UpdateWindow (hWnd);					while (GetMessage(&amp;msg, NULL,0,0))	
   {
		TranslateMessage(&amp;msg);	//Nachrichtenschleife
      DispatchMessage(&amp;msg);
   }
	return msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
//WndProc bearbeitet alle Nachrichten, die für diese Fensterklasse bestimmt sind.
{
	switch (message)
   {
   	case WM_COMMAND:
      {
      	switch (LOWORD(wParam))
         {  //Dazwischen noch ein bischen Quelltext, tut hier nicht zur Sache
            case IDM_TB_SHOW:
            {
            	tb_add_button(hToolBar, 1, IDB_BITMAP2, TBSTYLE_BUTTON);//Einfügen des Buttons.
               break;
            }

         }
         break;
      }

   	case WM_DESTROY:
      {
      	PostQuitMessage (0);	//Beendung der Anwendung
         return 0;
      }
   }
   return DefWindowProc(hwnd, message, wParam, lParam); 	//DefaultWindowProcedure, Standardbearbeitung.

}
////////////////////////////////////////////////////////////////////////////////////////

void tb_add_button(HWND hToolBar, int command, int bitmap, int style)
{
	HBITMAP h_Bitmap;
   h_Bitmap = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(bitmap));
   if (h_Bitmap==NULL)
   {
   	MessageBox(NULL, &quot;kein Bitmap geladen&quot;, &quot;Bitmapfehler&quot;, MB_ICONEXCLAMATION|MB_OK|MB_DEFBUTTON1);
   }

   TBADDBITMAP bitid;
   bitid.hInst = GetModuleHandle(NULL);
   bitid.nID = (UINT)h_Bitmap;

   TBBUTTON newbutton;
   newbutton.iBitmap = SendMessage(hToolBar, TB_ADDBITMAP, 1, (long)&amp;bitid);
   newbutton.idCommand = command;
   newbutton.fsState = TBSTATE_ENABLED;
   newbutton.fsStyle = style;
   newbutton.dwData = 0;
   newbutton.iString = NULL;
   SendMessage(hToolBar, TB_ADDBUTTONS, (WPARAM)1, (LPARAM)(LPTBBUTTON)&amp;newbutton);
}
</code></pre>
<p>Das Einfügen des Button funktioniert schonmal. Aber der Button ist nackt, hat keine Bitmap. Es wird aber auch kein Bitmap-Fehler angezeigt (siehe MessageBox).</p>
<p>Wo steckt da noch ein Fehler?<br />
Bei der Gelegenheit wüßte ich auch gerne, wie man den Button wieder aus der Symbolleiste entfernt- und zwar nicht mur mit TBSTATE_HIDDEN versteckt, sondern zur Laufzeit richtig aus der Leiste löscht? Gibt es eine Funktion wie z. B. TB_DELETEBUTTON oder ähnliches?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1139976</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1139976</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Mon, 18 Sep 2006 19:33:08 GMT</pubDate></item><item><title><![CDATA[Reply to Schaltfläche in Symbolleiste zur Laufzeit einfügen on Tue, 19 Sep 2006 09:51:18 GMT]]></title><description><![CDATA[<p>Die letzte Frage hat sich erledigt. TB_DELETEBUTTON gibt es tatsächlich. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
<p>Aber die andere Frage bleibt: Auf meiner neuen Schaltfläche erscheint kein Bitmap, obwohl ich eines angegeben habe. Ich bekomme auch keine Fehlermeldung (Quelltext siehe mein letztes Posting). Was mache ich falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1140200</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1140200</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Tue, 19 Sep 2006 09:51:18 GMT</pubDate></item><item><title><![CDATA[Reply to Schaltfläche in Symbolleiste zur Laufzeit einfügen on Wed, 20 Sep 2006 09:08:37 GMT]]></title><description><![CDATA[<p>Was lange gährt, wird endlich Wut- oder so ähnlich. Ich habs selbst herausgefunden.</p>
<p>Bei TBADDBITMAP muß hInst auf NULL gesetzt werden, weil ich die Bitmap aus einer Resource laden wollte. GetModuleHandle(NULL) funktioniert nur, wenn man das Bitmap aus einer Datei läd, oder, wenn man Standardsymbole benutzt. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1140599</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1140599</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Wed, 20 Sep 2006 09:08:37 GMT</pubDate></item></channel></rss>