<?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[Label in TabControl?]]></title><description><![CDATA[<p>Wie bekomme ich ein Label in ein TabControl - habs mal so versucht:</p>
<pre><code class="language-cpp">HWND WINAPI DoCreateTabControl(HWND hwndParent) 
{ 
    RECT rcClient; 
    HWND hwndTab; 
    TCITEM tie; 
    int i; 

    // Get the dimensions of the parent window's client area, and 
    // create a tab control child window of that size. 
    GetClientRect(hwndParent, &amp;rcClient); 
    InitCommonControls(); 
    hwndTab = CreateWindow( 
        WC_TABCONTROL, L&quot;&quot;, 
        WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE, 
        0, 0, rcClient.right, rcClient.bottom, 
        hwndParent, NULL, g_hinst, NULL 
        ); 
    if (hwndTab == NULL) 
        return NULL; 

    // Add tabs for each day of the week. 
    tie.mask = TCIF_TEXT | TCIF_IMAGE; 
    tie.iImage = -1; 
    tie.pszText = g_achTemp; 

    for (i = 0; i &lt; 4; i++) { 
        //LoadString(g_hinst, &quot;&quot;IDS_FIRSTDAY + i, 
          //      g_achTemp, sizeof(g_achTemp)/sizeof(g_achTemp[0])); 

        if (TabCtrl_InsertItem(hwndTab, i, &amp;tie) == -1) { 
            DestroyWindow(hwndTab); 
            return NULL; 
        } 
    } 

	TC_ITEM ti;

	ti.mask = TCIF_TEXT | TCIF_PARAM;
	ti.pszText = L&quot;texto&quot;;
	ti.lParam = (LPARAM)  CreateWindowEx (0, L&quot;STATIC&quot;, L&quot;label&quot;, WS_VISIBLE | WS_CHILD,
				50, 50, 100,100, hwndTab,
				(HMENU) NULL, (HINSTANCE) GetModuleHandle (NULL), NULL);

	TabCtrl_InsertItem(hwndTab, 2, &amp;ti);

    return hwndTab; 
}
</code></pre>
<p>Wollte in das 2te Tab Control das Label setzen - funzt aber so nicht - hat jemand vielleicht Beispielprogrammcode rumliegen oder sieht jemand was ich falsch mache?</p>
<p>Hier der ganze Code zum Rumspielen:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;commctrl.h&gt;

// Global variables 

HINSTANCE g_hinst;    // handle to application instance 
wchar_t g_achTemp[256];  // temporary buffer for strings 
//HWND g_hwndMain;      // main application window 
//HWND g_hwndTab;       // tab control 
//HWND g_hwndDisplay;   // handle to static control in 
//                      //   tab control's display area 

LRESULT CALLBACK WindowProc(HWND hwnd,
UINT msg,
WPARAM wparam,
LPARAM lparam)
{
        switch(msg)
        {
                case WM_DESTROY:
                PostQuitMessage(0);
                return 0;
                default: break;
        }

        return (DefWindowProc(hwnd, msg, wparam, lparam));
}

// DoCreateTabControl - creates a tab control, sized to fit the 
//     specified parent window's client area, and adds some tabs. 
// Returns the handle to the tab control. 
// hwndParent - parent window (the application's main window). 

HWND WINAPI DoCreateTabControl(HWND hwndParent) 
{ 
    RECT rcClient; 
    HWND hwndTab; 
    TCITEM tie; 
    int i; 

    // Get the dimensions of the parent window's client area, and 
    // create a tab control child window of that size. 
    GetClientRect(hwndParent, &amp;rcClient); 
    InitCommonControls(); 
    hwndTab = CreateWindow( 
        WC_TABCONTROL, L&quot;&quot;, 
        WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE, 
        0, 0, rcClient.right, rcClient.bottom, 
        hwndParent, NULL, g_hinst, NULL 
        ); 
    if (hwndTab == NULL) 
        return NULL; 

    // Add tabs for each day of the week. 
    tie.mask = TCIF_TEXT | TCIF_IMAGE; 
    tie.iImage = -1; 
    tie.pszText = g_achTemp; 

    for (i = 0; i &lt; 4; i++) { 
        //LoadString(g_hinst, &quot;&quot;IDS_FIRSTDAY + i, 
          //      g_achTemp, sizeof(g_achTemp)/sizeof(g_achTemp[0])); 

        if (TabCtrl_InsertItem(hwndTab, i, &amp;tie) == -1) { 
            DestroyWindow(hwndTab); 
            return NULL; 
        } 
    } 

	TC_ITEM ti;

	ti.mask = TCIF_TEXT | TCIF_PARAM;
	ti.pszText = L&quot;texto&quot;;
	ti.lParam = (LPARAM)  CreateWindowEx (0, L&quot;STATIC&quot;, L&quot;label&quot;, WS_VISIBLE | WS_CHILD,
				50, 50, 100,100, hwndTab,
				(HMENU) NULL, (HINSTANCE) GetModuleHandle (NULL), NULL);

	TabCtrl_InsertItem(hwndTab, 2, &amp;ti);

    return hwndTab; 
} 

int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE  hPrevInstance,
LPSTR lpCmdline,
int nCmdShow)
{
	g_hinst = hInstance;

        WNDCLASSEX winclass;
        winclass.cbSize = sizeof(WNDCLASSEX);
        winclass.style = CS_VREDRAW | CS_HREDRAW | CS_OWNDC | CS_DBLCLKS;
        winclass.lpfnWndProc = WindowProc;
        winclass.cbClsExtra = 0;    // extra class info space
        winclass.cbWndExtra = 0;    // extra window info space
        winclass.hInstance = hInstance; // assign the application instance
        winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
        winclass.hCursor = LoadCursor(NULL, IDC_ARROW);
        winclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
        winclass.lpszMenuName = NULL; // the name of the menu to attach
        winclass.lpszClassName = L&quot;WINCLASS1&quot;; // the name of the class itself
        winclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);

        RegisterClassEx(&amp;winclass);

		HWND hwnd;
        if((hwnd = CreateWindowEx(NULL,
        L&quot;WINCLASS1&quot;,
        L&quot;Fenstertitel&quot;,
        WS_OVERLAPPEDWINDOW | WS_VISIBLE,
        0,
        0,
        400,
        400,
        NULL, // handle to parent
        NULL, // handle to menu
        hInstance, // instance of this application
        NULL)) == NULL)
        return 0;

		DoCreateTabControl(hwnd);
        //UpdateWindow();

        MSG msg;
        while(GetMessage(&amp;msg, NULL, 0, 0))
        {
                // translate any accelerator keys
                TranslateMessage(&amp;msg);

                // send the message to the window proc
                DispatchMessage(&amp;msg);
        }

        return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/160492/label-in-tabcontrol</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Jul 2026 22:05:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/160492.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 26 Sep 2006 11:59:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Label in TabControl? on Tue, 26 Sep 2006 11:59:41 GMT]]></title><description><![CDATA[<p>Wie bekomme ich ein Label in ein TabControl - habs mal so versucht:</p>
<pre><code class="language-cpp">HWND WINAPI DoCreateTabControl(HWND hwndParent) 
{ 
    RECT rcClient; 
    HWND hwndTab; 
    TCITEM tie; 
    int i; 

    // Get the dimensions of the parent window's client area, and 
    // create a tab control child window of that size. 
    GetClientRect(hwndParent, &amp;rcClient); 
    InitCommonControls(); 
    hwndTab = CreateWindow( 
        WC_TABCONTROL, L&quot;&quot;, 
        WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE, 
        0, 0, rcClient.right, rcClient.bottom, 
        hwndParent, NULL, g_hinst, NULL 
        ); 
    if (hwndTab == NULL) 
        return NULL; 

    // Add tabs for each day of the week. 
    tie.mask = TCIF_TEXT | TCIF_IMAGE; 
    tie.iImage = -1; 
    tie.pszText = g_achTemp; 

    for (i = 0; i &lt; 4; i++) { 
        //LoadString(g_hinst, &quot;&quot;IDS_FIRSTDAY + i, 
          //      g_achTemp, sizeof(g_achTemp)/sizeof(g_achTemp[0])); 

        if (TabCtrl_InsertItem(hwndTab, i, &amp;tie) == -1) { 
            DestroyWindow(hwndTab); 
            return NULL; 
        } 
    } 

	TC_ITEM ti;

	ti.mask = TCIF_TEXT | TCIF_PARAM;
	ti.pszText = L&quot;texto&quot;;
	ti.lParam = (LPARAM)  CreateWindowEx (0, L&quot;STATIC&quot;, L&quot;label&quot;, WS_VISIBLE | WS_CHILD,
				50, 50, 100,100, hwndTab,
				(HMENU) NULL, (HINSTANCE) GetModuleHandle (NULL), NULL);

	TabCtrl_InsertItem(hwndTab, 2, &amp;ti);

    return hwndTab; 
}
</code></pre>
<p>Wollte in das 2te Tab Control das Label setzen - funzt aber so nicht - hat jemand vielleicht Beispielprogrammcode rumliegen oder sieht jemand was ich falsch mache?</p>
<p>Hier der ganze Code zum Rumspielen:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;commctrl.h&gt;

// Global variables 

HINSTANCE g_hinst;    // handle to application instance 
wchar_t g_achTemp[256];  // temporary buffer for strings 
//HWND g_hwndMain;      // main application window 
//HWND g_hwndTab;       // tab control 
//HWND g_hwndDisplay;   // handle to static control in 
//                      //   tab control's display area 

LRESULT CALLBACK WindowProc(HWND hwnd,
UINT msg,
WPARAM wparam,
LPARAM lparam)
{
        switch(msg)
        {
                case WM_DESTROY:
                PostQuitMessage(0);
                return 0;
                default: break;
        }

        return (DefWindowProc(hwnd, msg, wparam, lparam));
}

// DoCreateTabControl - creates a tab control, sized to fit the 
//     specified parent window's client area, and adds some tabs. 
// Returns the handle to the tab control. 
// hwndParent - parent window (the application's main window). 

HWND WINAPI DoCreateTabControl(HWND hwndParent) 
{ 
    RECT rcClient; 
    HWND hwndTab; 
    TCITEM tie; 
    int i; 

    // Get the dimensions of the parent window's client area, and 
    // create a tab control child window of that size. 
    GetClientRect(hwndParent, &amp;rcClient); 
    InitCommonControls(); 
    hwndTab = CreateWindow( 
        WC_TABCONTROL, L&quot;&quot;, 
        WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE, 
        0, 0, rcClient.right, rcClient.bottom, 
        hwndParent, NULL, g_hinst, NULL 
        ); 
    if (hwndTab == NULL) 
        return NULL; 

    // Add tabs for each day of the week. 
    tie.mask = TCIF_TEXT | TCIF_IMAGE; 
    tie.iImage = -1; 
    tie.pszText = g_achTemp; 

    for (i = 0; i &lt; 4; i++) { 
        //LoadString(g_hinst, &quot;&quot;IDS_FIRSTDAY + i, 
          //      g_achTemp, sizeof(g_achTemp)/sizeof(g_achTemp[0])); 

        if (TabCtrl_InsertItem(hwndTab, i, &amp;tie) == -1) { 
            DestroyWindow(hwndTab); 
            return NULL; 
        } 
    } 

	TC_ITEM ti;

	ti.mask = TCIF_TEXT | TCIF_PARAM;
	ti.pszText = L&quot;texto&quot;;
	ti.lParam = (LPARAM)  CreateWindowEx (0, L&quot;STATIC&quot;, L&quot;label&quot;, WS_VISIBLE | WS_CHILD,
				50, 50, 100,100, hwndTab,
				(HMENU) NULL, (HINSTANCE) GetModuleHandle (NULL), NULL);

	TabCtrl_InsertItem(hwndTab, 2, &amp;ti);

    return hwndTab; 
} 

int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE  hPrevInstance,
LPSTR lpCmdline,
int nCmdShow)
{
	g_hinst = hInstance;

        WNDCLASSEX winclass;
        winclass.cbSize = sizeof(WNDCLASSEX);
        winclass.style = CS_VREDRAW | CS_HREDRAW | CS_OWNDC | CS_DBLCLKS;
        winclass.lpfnWndProc = WindowProc;
        winclass.cbClsExtra = 0;    // extra class info space
        winclass.cbWndExtra = 0;    // extra window info space
        winclass.hInstance = hInstance; // assign the application instance
        winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
        winclass.hCursor = LoadCursor(NULL, IDC_ARROW);
        winclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
        winclass.lpszMenuName = NULL; // the name of the menu to attach
        winclass.lpszClassName = L&quot;WINCLASS1&quot;; // the name of the class itself
        winclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);

        RegisterClassEx(&amp;winclass);

		HWND hwnd;
        if((hwnd = CreateWindowEx(NULL,
        L&quot;WINCLASS1&quot;,
        L&quot;Fenstertitel&quot;,
        WS_OVERLAPPEDWINDOW | WS_VISIBLE,
        0,
        0,
        400,
        400,
        NULL, // handle to parent
        NULL, // handle to menu
        hInstance, // instance of this application
        NULL)) == NULL)
        return 0;

		DoCreateTabControl(hwnd);
        //UpdateWindow();

        MSG msg;
        while(GetMessage(&amp;msg, NULL, 0, 0))
        {
                // translate any accelerator keys
                TranslateMessage(&amp;msg);

                // send the message to the window proc
                DispatchMessage(&amp;msg);
        }

        return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1144675</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1144675</guid><dc:creator><![CDATA[Vertexwahn]]></dc:creator><pubDate>Tue, 26 Sep 2006 11:59:41 GMT</pubDate></item><item><title><![CDATA[Reply to Label in TabControl? on Tue, 26 Sep 2006 12:47:58 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>Nee so geht das nicht :p ... Man erstellt erst das Tab-Control, fügt dann Items<br />
hinzu, setzt dann Dialoge, auf denen man zu guter Letzt die Child-Controls<br />
plaziert.</p>
<p><a href="http://winapi.net/index.php?inhalt=t4" rel="nofollow">Hier</a> ist n Turorial <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/1144714</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1144714</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Tue, 26 Sep 2006 12:47:58 GMT</pubDate></item><item><title><![CDATA[Reply to Label in TabControl? on Tue, 26 Sep 2006 12:54:50 GMT]]></title><description><![CDATA[<p>ich will keine Resourcen verwenden - nur reines WinAPI</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1144723</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1144723</guid><dc:creator><![CDATA[Vertexwahn]]></dc:creator><pubDate>Tue, 26 Sep 2006 12:54:50 GMT</pubDate></item><item><title><![CDATA[Reply to Label in TabControl? on Tue, 26 Sep 2006 12:59:52 GMT]]></title><description><![CDATA[<p>Vertexwahn schrieb:</p>
<blockquote>
<p>ich will keine Resourcen verwenden - nur reines WinAPI</p>
</blockquote>
<p>Wo ist das Problem ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1144727</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1144727</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Tue, 26 Sep 2006 12:59:52 GMT</pubDate></item><item><title><![CDATA[Reply to Label in TabControl? on Tue, 26 Sep 2006 13:20:23 GMT]]></title><description><![CDATA[<p>ok aus der Resource was aus reinem WinAPI zu machen ist kein Problem, aber:</p>
<pre><code class="language-cpp">if((nCurSel &gt;= 0) &amp;&amp; (nCurSel &lt;= 1))
  ShowWindow(phDlg[nCurSel], SW_HIDE);
</code></pre>
<p>wtf? das ist doch nicht ernst gemeint - oder <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="😉"
    /> - ich soll alle Controls verstecken und nur die Anzeigen die auf dem jeweiligen Tab sichtbar sein sollen - das kanns doch nicht sein - hat dieses Tab Control nicht selber eigene Verwaltungfunktionen für sowas?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1144741</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1144741</guid><dc:creator><![CDATA[Vertexwahn]]></dc:creator><pubDate>Tue, 26 Sep 2006 13:20:23 GMT</pubDate></item><item><title><![CDATA[Reply to Label in TabControl? on Tue, 26 Sep 2006 13:54:16 GMT]]></title><description><![CDATA[<p>Nop, ist eben WinAPI...</p>
<p>Du kannst sie auch alle platt machen (DestroyWindow) um Speicher zu sparen und später wieder erstellen...aber um diesen Mechanismus kommste mit reiner WinAPI nit herum :p .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1144790</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1144790</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Tue, 26 Sep 2006 13:54:16 GMT</pubDate></item></channel></rss>