<?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 in IE anzeigen ... ?]]></title><description><![CDATA[<p>Hi,<br />
Ich weiß dass es hier schon ahnliche Thread gab aber ich finde einfach keine Lösung zu meinem Problem <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /><br />
Ich will die Toolbar die ich mit <strong>CreateToolbarEx()</strong> erstelle an den IE versenden dass er im der Anpassen... Dialog ist und das mit <strong>SendMessage(hwnd_toolbar, TB_CUSTOMIZE, NULL, NULL);</strong> aber irgendwie klappt das nicht. Hier der Code :</p>
<pre><code class="language-cpp">#define _WIN32_IE 0x501 //For TBSTYLE_FLAT Konstante

#include &lt;windows.h&gt;
#include &lt;iostream.h&gt;
#include &lt;commctrl.h&gt;   //For extended controls

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

int button_id = 0;

HWND hwnd_toolbar, hwnd;

void tb_add_separator( HWND hwnd_toolbar )
{
    if (hwnd_toolbar != NULL)       //Continue only if there is a toolbar
    {
        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_toolbar, TB_ADDBUTTONS, (WPARAM) 1, (LPARAM) (LPTBBUTTON) &amp;tbbutton);
    }
}

void tb_add_button(HWND hwnd_toolbar, int command, char* bitmap_filename, int style = TBSTYLE_BUTTON)
{
    if (hwnd_toolbar != NULL)       //Continue only if there is a toolbar
    {
        //Bitmap einladen
        HBITMAP h_bitmap;
        h_bitmap = (HBITMAP)LoadImage(  NULL,
                                        bitmap_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_toolbar, 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_toolbar, TB_ADDBUTTONS, (WPARAM) 1, (LPARAM) (LPTBBUTTON) &amp;tbbutton);
    }
}

HWND tb_create( HINSTANCE instance, HWND hwnd, int style )
{
    InitCommonControls();

    //Create window for toolbar, parent is current window
    HWND hwnd_toolbar = CreateWindowEx(  0,
                                    TOOLBARCLASSNAME,
                                    (LPSTR) NULL,
                                    WS_CHILD | style,
                                    0, 0, 0, 0,
                                    hwnd,
                                    (HMENU) 1,
                                    instance,
                                    NULL
                                );
    if (!hwnd)      //Continue if creating toolbar was successfull
    {
        return NULL;
    }

    //Add Standard-Buttons to toolbar's Image-List
    TBADDBITMAP bitid;
    bitid.hInst = HINST_COMMCTRL;
    bitid.nID = IDB_STD_SMALL_COLOR;
    SendMessage(hwnd_toolbar, TB_ADDBITMAP, 1, (long)&amp;bitid);

    SendMessage(hwnd_toolbar, TB_BUTTONSTRUCTSIZE, (WPARAM) sizeof(TBBUTTON), 0);       //Backward 

compatiblity
    ShowWindow(hwnd_toolbar, SW_SHOW);                                                  //Show 

Toolbar!
    return hwnd_toolbar;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    PSTR szCmdLine, int showpref)
{
    static char AppName[] = &quot;WinTextedit 1.0&quot;;
    MSG msg;
    WNDCLASS wndclass;

    wndclass.style = NULL;
    wndclass.lpfnWndProc = WndProc;
    wndclass.cbClsExtra = 0;
    wndclass.cbWndExtra = 0;
    wndclass.hInstance = hInstance;
    wndclass.hIcon = LoadIcon(NULL, IDI_WINLOGO);
    wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
    wndclass.hbrBackground = (HBRUSH) COLOR_MENU + 3;
    wndclass.lpszMenuName = NULL;
    wndclass.lpszClassName = AppName;

    if (RegisterClass(&amp;wndclass) == false)
    {
        MessageBox(NULL, &quot;Es ist ein Fehler aufgetreten. &quot;, &quot;Error! &quot;, MB_ICONERROR);
        return 0;
    }

    hwnd = CreateWindow (AppName,
                         TEXT(&quot;Toolbar-Testprogramm&quot;),
                         WS_OVERLAPPEDWINDOW,
                         100,
                         100,
                         258,
                         314,
                         NULL,
                         NULL,
                         hInstance,
                         NULL);

    ShowWindow(hwnd, SW_SHOWNORMAL);
    UpdateWindow(hwnd);

    hwnd_toolbar = tb_create(hInstance, hwnd, TBSTYLE_FLAT);
    tb_add_button(hwnd_toolbar, 1, &quot;bitmap.bmp&quot;, TBSTYLE_CHECK);
    tb_add_button(hwnd_toolbar, 2, &quot;bitmap.bmp&quot;, TBSTYLE_CHECK);
    tb_add_button(hwnd_toolbar, 3, &quot;bitmap.bmp&quot;, TBSTYLE_CHECK);
    tb_add_separator(hwnd_toolbar);
    tb_add_button(hwnd_toolbar, 4, &quot;bitmap.bmp&quot;);
    tb_add_button(hwnd_toolbar, 5, &quot;bitmap.bmp&quot;);

    SendMessage(hwnd_toolbar, TB_CUSTOMIZE, NULL, NULL); 
    /* Hier die nachricht ???????? */

    while(GetMessage(&amp;msg, NULL, 0, 0))
    {
        TranslateMessage(&amp;msg);
        DispatchMessage(&amp;msg);
    }
    return msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{

    switch(message)
    {

    case WM_COMMAND:
        button_id = LOWORD(wParam);
        return 0;

    case WM_DESTROY:
        PostQuitMessage(0);
        return 0;
    }

    return DefWindowProc(hwnd, message, wParam, lParam);
}
</code></pre>
<p>Ich hoffe ihr könnt mir helfen .<br />
Gruß <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>
]]></description><link>https://www.c-plusplus.net/forum/topic/123314/toolbar-in-ie-anzeigen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Jul 2026 19:10:09 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/123314.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 15 Oct 2005 10:07:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Toolbar in IE anzeigen ... ? on Sat, 15 Oct 2005 10:07:28 GMT]]></title><description><![CDATA[<p>Hi,<br />
Ich weiß dass es hier schon ahnliche Thread gab aber ich finde einfach keine Lösung zu meinem Problem <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /><br />
Ich will die Toolbar die ich mit <strong>CreateToolbarEx()</strong> erstelle an den IE versenden dass er im der Anpassen... Dialog ist und das mit <strong>SendMessage(hwnd_toolbar, TB_CUSTOMIZE, NULL, NULL);</strong> aber irgendwie klappt das nicht. Hier der Code :</p>
<pre><code class="language-cpp">#define _WIN32_IE 0x501 //For TBSTYLE_FLAT Konstante

#include &lt;windows.h&gt;
#include &lt;iostream.h&gt;
#include &lt;commctrl.h&gt;   //For extended controls

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

int button_id = 0;

HWND hwnd_toolbar, hwnd;

void tb_add_separator( HWND hwnd_toolbar )
{
    if (hwnd_toolbar != NULL)       //Continue only if there is a toolbar
    {
        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_toolbar, TB_ADDBUTTONS, (WPARAM) 1, (LPARAM) (LPTBBUTTON) &amp;tbbutton);
    }
}

void tb_add_button(HWND hwnd_toolbar, int command, char* bitmap_filename, int style = TBSTYLE_BUTTON)
{
    if (hwnd_toolbar != NULL)       //Continue only if there is a toolbar
    {
        //Bitmap einladen
        HBITMAP h_bitmap;
        h_bitmap = (HBITMAP)LoadImage(  NULL,
                                        bitmap_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_toolbar, 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_toolbar, TB_ADDBUTTONS, (WPARAM) 1, (LPARAM) (LPTBBUTTON) &amp;tbbutton);
    }
}

HWND tb_create( HINSTANCE instance, HWND hwnd, int style )
{
    InitCommonControls();

    //Create window for toolbar, parent is current window
    HWND hwnd_toolbar = CreateWindowEx(  0,
                                    TOOLBARCLASSNAME,
                                    (LPSTR) NULL,
                                    WS_CHILD | style,
                                    0, 0, 0, 0,
                                    hwnd,
                                    (HMENU) 1,
                                    instance,
                                    NULL
                                );
    if (!hwnd)      //Continue if creating toolbar was successfull
    {
        return NULL;
    }

    //Add Standard-Buttons to toolbar's Image-List
    TBADDBITMAP bitid;
    bitid.hInst = HINST_COMMCTRL;
    bitid.nID = IDB_STD_SMALL_COLOR;
    SendMessage(hwnd_toolbar, TB_ADDBITMAP, 1, (long)&amp;bitid);

    SendMessage(hwnd_toolbar, TB_BUTTONSTRUCTSIZE, (WPARAM) sizeof(TBBUTTON), 0);       //Backward 

compatiblity
    ShowWindow(hwnd_toolbar, SW_SHOW);                                                  //Show 

Toolbar!
    return hwnd_toolbar;
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    PSTR szCmdLine, int showpref)
{
    static char AppName[] = &quot;WinTextedit 1.0&quot;;
    MSG msg;
    WNDCLASS wndclass;

    wndclass.style = NULL;
    wndclass.lpfnWndProc = WndProc;
    wndclass.cbClsExtra = 0;
    wndclass.cbWndExtra = 0;
    wndclass.hInstance = hInstance;
    wndclass.hIcon = LoadIcon(NULL, IDI_WINLOGO);
    wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
    wndclass.hbrBackground = (HBRUSH) COLOR_MENU + 3;
    wndclass.lpszMenuName = NULL;
    wndclass.lpszClassName = AppName;

    if (RegisterClass(&amp;wndclass) == false)
    {
        MessageBox(NULL, &quot;Es ist ein Fehler aufgetreten. &quot;, &quot;Error! &quot;, MB_ICONERROR);
        return 0;
    }

    hwnd = CreateWindow (AppName,
                         TEXT(&quot;Toolbar-Testprogramm&quot;),
                         WS_OVERLAPPEDWINDOW,
                         100,
                         100,
                         258,
                         314,
                         NULL,
                         NULL,
                         hInstance,
                         NULL);

    ShowWindow(hwnd, SW_SHOWNORMAL);
    UpdateWindow(hwnd);

    hwnd_toolbar = tb_create(hInstance, hwnd, TBSTYLE_FLAT);
    tb_add_button(hwnd_toolbar, 1, &quot;bitmap.bmp&quot;, TBSTYLE_CHECK);
    tb_add_button(hwnd_toolbar, 2, &quot;bitmap.bmp&quot;, TBSTYLE_CHECK);
    tb_add_button(hwnd_toolbar, 3, &quot;bitmap.bmp&quot;, TBSTYLE_CHECK);
    tb_add_separator(hwnd_toolbar);
    tb_add_button(hwnd_toolbar, 4, &quot;bitmap.bmp&quot;);
    tb_add_button(hwnd_toolbar, 5, &quot;bitmap.bmp&quot;);

    SendMessage(hwnd_toolbar, TB_CUSTOMIZE, NULL, NULL); 
    /* Hier die nachricht ???????? */

    while(GetMessage(&amp;msg, NULL, 0, 0))
    {
        TranslateMessage(&amp;msg);
        DispatchMessage(&amp;msg);
    }
    return msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{

    switch(message)
    {

    case WM_COMMAND:
        button_id = LOWORD(wParam);
        return 0;

    case WM_DESTROY:
        PostQuitMessage(0);
        return 0;
    }

    return DefWindowProc(hwnd, message, wParam, lParam);
}
</code></pre>
<p>Ich hoffe ihr könnt mir helfen .<br />
Gruß <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>
]]></description><link>https://www.c-plusplus.net/forum/post/892740</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/892740</guid><dc:creator><![CDATA[~tux]]></dc:creator><pubDate>Sat, 15 Oct 2005 10:07:28 GMT</pubDate></item><item><title><![CDATA[Reply to Toolbar in IE anzeigen ... ? on Sat, 15 Oct 2005 10:19:04 GMT]]></title><description><![CDATA[<p>Ich verstehe nicht so ganz, was du vorhast - vielleicht findest du <a href="http://msdn.microsoft.com/workshop/browser/ext/extensions.asp" rel="nofollow">hier</a> was passendes für dich...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/892745</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/892745</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Sat, 15 Oct 2005 10:19:04 GMT</pubDate></item><item><title><![CDATA[Reply to Toolbar in IE anzeigen ... ? on Sat, 15 Oct 2005 12:36:13 GMT]]></title><description><![CDATA[<p>Danke für die Antwort also ich will eine einfache Toolbar für den IE erstellen<br />
so wie von google oder so ...</p>
<p>Gruß <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="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/892795</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/892795</guid><dc:creator><![CDATA[~tux]]></dc:creator><pubDate>Sat, 15 Oct 2005 12:36:13 GMT</pubDate></item><item><title><![CDATA[Reply to Toolbar in IE anzeigen ... ? on Sat, 15 Oct 2005 16:38:23 GMT]]></title><description><![CDATA[<p>Ok, dann solltest du dort richtig sein - speziell &quot;Adding Explorer Bars&quot; <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>
]]></description><link>https://www.c-plusplus.net/forum/post/892944</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/892944</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Sat, 15 Oct 2005 16:38:23 GMT</pubDate></item></channel></rss>