<?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[Tab Control]]></title><description><![CDATA[<p>Hey,<br />
ich krieg einfach keinen Inhalt beim Tab Control rein. Ich nutze das Tutorial von <a href="http://winapi.net" rel="nofollow">winapi.net</a>. Kann mir jemand vill erklären wie man dort Inhalt reinbekommt.</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/197416/tab-control</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 12:04:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/197416.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 10 Nov 2007 11:37:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Tab Control on Sat, 10 Nov 2007 11:37:29 GMT]]></title><description><![CDATA[<p>Hey,<br />
ich krieg einfach keinen Inhalt beim Tab Control rein. Ich nutze das Tutorial von <a href="http://winapi.net" rel="nofollow">winapi.net</a>. Kann mir jemand vill erklären wie man dort Inhalt reinbekommt.</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1400798</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1400798</guid><dc:creator><![CDATA[Test23]]></dc:creator><pubDate>Sat, 10 Nov 2007 11:37:29 GMT</pubDate></item><item><title><![CDATA[Reply to Tab Control on Sat, 10 Nov 2007 12:06:04 GMT]]></title><description><![CDATA[<p>An welcher Stelle des Tutorials hast Du Probleme?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1400828</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1400828</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sat, 10 Nov 2007 12:06:04 GMT</pubDate></item><item><title><![CDATA[Reply to Tab Control on Sat, 10 Nov 2007 17:24:23 GMT]]></title><description><![CDATA[<p>Naja er beachtet nicht die Dialoge.<br />
Wenn ich z.B in einem Dialog eine normale Messagebox anzeigen lassen möchte macht er dies nicht. Hier der Code:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;commctrl.h&gt;
#include &lt;tchar.h&gt;
#include &lt;uxtheme.h&gt;
#include &quot;resource.h&quot;

// ID für das TabCtrl
#define IDC_TAB  50

// Hier werden die Dialoge für das TabCtrl vorbereitet. Noetig ist
// das aber nur unter XP.
typedef HRESULT (WINAPI * ENABLETHEMEDIALOGTEXTURE)(HWND, DWORD);

HRESULT WINAPI MyEnableThemeDialogTexture(HWND hWnd, DWORD dwFlags)
{
  ENABLETHEMEDIALOGTEXTURE pfnETDT;
  HINSTANCE                hDll;
  HRESULT                  hr;

    hr = HRESULT_FROM_WIN32(ERROR_CALL_NOT_IMPLEMENTED);

    if(NULL != (hDll = LoadLibrary(TEXT(&quot;uxtheme.dll&quot;))))
    {
        if(NULL != (pfnETDT = (ENABLETHEMEDIALOGTEXTURE)GetProcAddress(hDll, &quot;EnableThemeDialogTexture&quot;)))
        {
            hr = pfnETDT(hWnd, dwFlags);
        }
        FreeLibrary(hDll);
    }

  return(hr);
}

// Die DialogProcs gehoeren zu den Dialogen, die im TabCtrl
// angezeigt werden. In der echten Anwendung wird hier
// vermutlich etwas mehr stehen. ;-)
INT_PTR CALLBACK DlgProc1(HWND, UINT uMsg, WPARAM, LPARAM)
{
    switch(uMsg)
    {
        case WM_INITDIALOG:
             MessageBox(NULL,&quot;&quot;,&quot;&quot;,0);
             return(TRUE);
        default:
             MessageBox(NULL,&quot;&quot;,&quot;&quot;,0);
             break;
    }

  return(FALSE);
}

INT_PTR CALLBACK DlgProc2(HWND, UINT uMsg, WPARAM, LPARAM)
{
    switch(uMsg)
    {
        case WM_INITDIALOG:
             return(TRUE);
        default:
             break;
    }

  return(FALSE);
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
  TCITEM item;
  HWND*  phDlg;
  HWND   hWndTemp;
  RECT   rc;
  int    nCurSel;

    switch(uMsg)
    {
        case WM_CREATE:
             // TabCtrl erstellen und initialisieren
             hWndTemp = CreateWindowEx(0, WC_TABCONTROL, TEXT(&quot;&quot;), WS_CHILD |
 WS_VISIBLE | WS_TABSTOP | WS_CLIPSIBLINGS | TCS_FOCUSNEVER | TCS_SINGLELINE, 0, 0, 0, 0, hWnd, (HMENU)IDC_TAB, ((LPCREATESTRUCT)lParam)-&gt;hInstance, NULL);

             SendMessage(hWndTemp, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), 0);

             ZeroMemory(&amp;item, sizeof(item));
             item.mask    = TCIF_TEXT;

             item.pszText = TEXT(&quot;Dialog 1&quot;);
             TabCtrl_InsertItem(hWndTemp, 0, &amp;item);
             item.pszText = TEXT(&quot;Dialog 2&quot;);
             TabCtrl_InsertItem(hWndTemp, 1, &amp;item);

             // Dialoge, die im TabCtrl erscheienen sollen, erzeugen
             phDlg    = new HWND[2];
             phDlg[0] = CreateDialog(((LPCREATESTRUCT)lParam)-&gt;hInstance, MAKEINTRESOURCE(IDD_DIALOG1), hWnd, DlgProc1);
             phDlg[1] = CreateDialog(((LPCREATESTRUCT)lParam)-&gt;hInstance, MAKEINTRESOURCE(IDD_DIALOG2), hWnd, DlgProc2);

             // Die Dialoge und das TabCtrl sind Geschwister. Da das TabCtrl
             // aber zuerst erstellt wurde, liegt es über den Dialogen. Damit
             // es nicht zu Darstellungsproblemen kommt, ist sicherzustellen,
             // das die Dialoge ueber dem TabCtrl liegen. Das leisten die
             // folgenden BringWindowToTop-Aufrufe.
             //
             // Schaut Euch das auch mit dem Spy++ an und vergleicht die Reihenfolge
             // der Fenster mit diesen Aufrufen mit der Reihenfolge ohne diesen Aufrufen
             // Wer den Spy++ nicht hat, kann alternativ ein anderes Tool benutzen, z.B.:
             // http://www.windows-spy.com/
             BringWindowToTop(phDlg[1]);
             BringWindowToTop(phDlg[0]);

             // Dialoge in TabCtrls haben unter Windows XP ein
             // anderes Aussehen als Dialoge, die nicht in einem
             // TabCtrl sitzen. Hier wird die Version des Tabs
             // getestet und bei Bedarf die Dialog entsprechend
             // angepasst
             if(SendMessage(hWndTemp, CCM_GETVERSION, 0, 0) &gt;= 6)
             {
                 MyEnableThemeDialogTexture(phDlg[0], NULL);
                 MyEnableThemeDialogTexture(phDlg[1], NULL);
             }

             // Handles der Child-Dialoge speichern
             SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)phDlg);
             return(0);
        case WM_ERASEBKGND:
             return(1);
        case WM_NOTIFY:
             switch(((LPNMHDR)lParam)-&gt;code)
             {
                 case TCN_SELCHANGING:
                      // Diese Notification wird gesendet, *bevor* das TabCtrl
                      // die Auswahl aendert. Das ist ein guter Zeitpunkt, um
                      // den zurzeit angezeigten Dialog zu verstecken
                      phDlg   = (HWND*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
                      nCurSel = TabCtrl_GetCurSel(((LPNMHDR)lParam)-&gt;hwndFrom);

                      if((nCurSel &gt;= 0) &amp;&amp; (nCurSel &lt;= 1))
                          ShowWindow(phDlg[nCurSel], SW_HIDE);

                      return(0);
                 case TCN_SELCHANGE:
                      // Diese Notification wird gesendet, *nachdem* das TabCtrl
                      // die Auswahl geaendert hat. Dies ist ein guter Zeitpunkt,
                      // um den zur Auswahl passenden Dialog anzuzeigen
                      phDlg   = (HWND*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
                      nCurSel = TabCtrl_GetCurSel(((LPNMHDR)lParam)-&gt;hwndFrom);

                      if((nCurSel &gt;= 0) &amp;&amp; (nCurSel &lt;= 1))
                          ShowWindow(phDlg[nCurSel], SW_SHOW);

                      return(0);
                 default:
                      break;
             }
             break;
        case WM_SIZE:
             phDlg    = (HWND*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
             hWndTemp = GetDlgItem(hWnd, IDC_TAB);

             // Das TabCtrl ueberdeckt die komplette Client-Area
             SetRect(&amp;rc, 0, 0, LOWORD(lParam), HIWORD(lParam));
             MoveWindow(hWndTemp, 0, 0, rc.right, rc.bottom, TRUE);

             // TCM_ADJUSTRECT berechnet die Display-Area des TabCtrls aus
             // den Koordinaten, die bereits in rc stehen. Die Werte in der
             // RECT-Struktur sind nach Rueckkehr entsrechend geaendert
             SendMessage(hWndTemp, TCM_ADJUSTRECT, (WPARAM)FALSE, (LPARAM)&amp;rc);
             MoveWindow(phDlg[0], rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE);
             MoveWindow(phDlg[1], rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE);

             return(0);
        case WM_NCDESTROY:
             // Das per new angeforderte Array muss natuerlich auch wieder
             // geloescht werden.  ;-)
             phDlg = (HWND*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
             delete [] phDlg;
             PostQuitMessage(0);
             return(0);
        default:
             break;
    }

  return(DefWindowProc(hWnd, uMsg, wParam, lParam));
}

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR, int nCmdShow)
{
  WNDCLASSEX           wc;
  HWND                 hWnd;
  MSG                  msg;

    InitCommonControls();

    wc.cbSize        = sizeof(wc);
    wc.style         = 0;
    wc.lpfnWndProc   = WndProc;
    wc.cbClsExtra    = 0;
    wc.cbWndExtra    = 0;
    wc.hInstance     = hInstance;
    wc.hIcon         = (HICON)LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor       = (HCURSOR)LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1);
    wc.lpszMenuName  = NULL;
    wc.lpszClassName = TEXT(&quot;TabCtrl-Test&quot;);
    wc.hIconSm       = (HICON)LoadIcon(NULL, IDI_APPLICATION);

    if(!RegisterClassEx(&amp;wc))
        return(0);
    if(NULL == (hWnd = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW | WS_EX_APPWINDOW,
 wc.lpszClassName, wc.lpszClassName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL)))
        return(0);

    ShowWindow(hWnd, nCmdShow);

    while(GetMessage(&amp;msg, NULL, 0, 0))
    {
        if(!IsDialogMessage(hWnd, &amp;msg))
        {
            TranslateMessage(&amp;msg);
            DispatchMessage (&amp;msg);
        }
    }

  return(msg.wParam);
}
</code></pre>
<pre><code class="language-cpp">//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by TabCtrl.rc
//
#define IDD_DIALOG1                     101
#define IDD_DIALOG2                     103
#define IDC_EDIT1                       1000
#define IDC_DONTCARE                    1003

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        102
#define _APS_NEXT_COMMAND_VALUE         40001
#define _APS_NEXT_CONTROL_VALUE         1004
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1401050</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1401050</guid><dc:creator><![CDATA[test23]]></dc:creator><pubDate>Sat, 10 Nov 2007 17:24:23 GMT</pubDate></item><item><title><![CDATA[Reply to Tab Control on Thu, 15 Nov 2007 14:12:07 GMT]]></title><description><![CDATA[<p>Hat keiner eine Idee?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1403682</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1403682</guid><dc:creator><![CDATA[test23]]></dc:creator><pubDate>Thu, 15 Nov 2007 14:12:07 GMT</pubDate></item><item><title><![CDATA[Reply to Tab Control on Tue, 05 Feb 2008 22:06:52 GMT]]></title><description><![CDATA[<p>Sry, Frage falsch verstanden.</p>
<p>lg Max</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1450127</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1450127</guid><dc:creator><![CDATA[MaDsTyLe]]></dc:creator><pubDate>Tue, 05 Feb 2008 22:06:52 GMT</pubDate></item><item><title><![CDATA[Reply to Tab Control on Wed, 06 Feb 2008 01:15:39 GMT]]></title><description><![CDATA[<p>Hast du bei den Dialogeinstellungen im Ressourceneditor den Dialog aktiviert und auf sichtbar gestellt? Jeden Dialog den du erstellst ist eben standardmäßig deaktiviert und unsichtbar. Oder habe ich die Frage falsch verstanden???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1450200</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1450200</guid><dc:creator><![CDATA[0xDEADBEEF]]></dc:creator><pubDate>Wed, 06 Feb 2008 01:15:39 GMT</pubDate></item></channel></rss>