<?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[Tabcontrol Problem]]></title><description><![CDATA[<p>Hi,</p>
<p>ich komm absolut nicht weiter. Hab meinem Programm jetzt ein Tabcontrol verpasst aber die Tabs tuen nicht so wie sie sollen. Wenn ich den Tab Register direkt anwähle erscheint nicht<br />
(norm. sollte eine kleine Liste angezeigt werden). Erst nachdem ich die Tabs Stack dump *und* Disassembler angewählt habe wird die Liste im Tab Register angezeigt.</p>
<p>Hier mal ein Codeausschnitt:</p>
<pre><code class="language-cpp">HWND	*phDlg;
INT		iCurSel	= 0;
TCITEM	item;
HWND	hWndTemp;
RECT	rc;

case WM_INITDIALOG:	
		{
			memset( &amp;item, 0, sizeof(item));

			hWndTemp = GetDlgItem( hDlgBugReport, IDC_TAB );
			if( hWndTemp == NULL )
			{
				#ifdef MYDBG
				MessageBoxA( NULL, &quot;Fehler GetDlgItem IDC_TAB&quot;, &quot;Fehler&quot;, MB_OK );
				#endif
				return FALSE;
			}

			item.mask  = TCIF_TEXT;

			// Tabs aufbauen
			item.pszText = L&quot;General&quot;;
            TabCtrl_InsertItem( hWndTemp, 0, &amp;item );

			item.pszText = L&quot;Processes&quot;;
            TabCtrl_InsertItem( hWndTemp, 1, &amp;item );

			item.pszText = L&quot;Modules&quot;;
            TabCtrl_InsertItem( hWndTemp, 2, &amp;item );

			item.pszText = L&quot;Call Stack&quot;;
            TabCtrl_InsertItem( hWndTemp, 3, &amp;item );

			item.pszText = L&quot;Registers&quot;;
            TabCtrl_InsertItem( hWndTemp, 4, &amp;item );

			item.pszText = L&quot;Stack dump&quot;;
            TabCtrl_InsertItem( hWndTemp, 5, &amp;item );

			item.pszText = L&quot;Disassembler&quot;;
            TabCtrl_InsertItem( hWndTemp, 6, &amp;item );

			// Dialoge, die im TabCtrl erscheienen sollen, erzeugen
			phDlg    = new HWND[7];
			phDlg[0] = CreateDialog( NULL, MAKEINTRESOURCE(IDD_TABDEFAULT), hDlgBugReport, TabGeneralProc );
			phDlg[1] = CreateDialog( NULL, MAKEINTRESOURCE(IDD_TABDEFAULT), hDlgBugReport, TabProcessesProc );
			phDlg[2] = CreateDialog( NULL, MAKEINTRESOURCE(IDD_TABDEFAULT), hDlgBugReport, TabModulesProc );
			phDlg[3] = CreateDialog( NULL, MAKEINTRESOURCE(IDD_TABDEFAULT), hDlgBugReport, TabCallStackProc );
			phDlg[4] = CreateDialog( NULL, MAKEINTRESOURCE(IDD_TABDEFAULT), hDlgBugReport, TabRegistersProc );
			phDlg[5] = CreateDialog( NULL, MAKEINTRESOURCE(IDD_TABDEFAULT), hDlgBugReport, TabStackDumpProc );
			phDlg[6] = CreateDialog( NULL, MAKEINTRESOURCE(IDD_TABDEFAULT), hDlgBugReport, TabDisassemblerProc );

			// 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.
			//for(int i=0;i&lt;7;i++)
			/*{
				BringWindowToTop( phDlg[6] );
				BringWindowToTop( phDlg[5] );
				BringWindowToTop( phDlg[4] );
				BringWindowToTop( phDlg[3] );
				BringWindowToTop( phDlg[2] );
				BringWindowToTop( phDlg[1] );
				BringWindowToTop( phDlg[0] );
			//}*/

			// Handles der Child-Dialoge speichern
			SetWindowLongPtr( hDlgBugReport, DWLP_USER, (LONG_PTR)phDlg );

			// Da sich der Dialog in der Groesse nicht verändern laesst,
			// muss die Grössenanpassung der Child-Dialoge bereits hier
			// erfolgen             
			GetWindowRect( hWndTemp, &amp;rc );
			ScreenToClient( hDlgBugReport, (LPPOINT)&amp;rc.left );
			ScreenToClient( hDlgBugReport, (LPPOINT)&amp;rc.right );
			SendMessage( hWndTemp, TCM_ADJUSTRECT, (WPARAM)FALSE, (LPARAM)&amp;rc );
			for(int i=0;i&lt;7;i++)
			{
				MoveWindow( phDlg[i], rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE );
			}
		}
		break;

		case WM_NOTIFY:
		{
			switch(((LPNMHDR)lParam)-&gt;code)
			{	
				case TCN_SELCHANGING:
				{  
					// Diese Notification wird gesendet, *bevor* das TabCtrl
					// die Auswahl ändert. Das ist ein guter Zeitpunkt, um
					// den zurzeit angezeigten Dialog zu verstecken
					phDlg   = (HWND*)GetWindowLongPtr( hDlgBugReport, DWLP_USER );
					iCurSel = TabCtrl_GetCurSel( ((LPNMHDR)lParam)-&gt;hwndFrom );

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

					SetWindowLongPtr( hDlgBugReport, DWLP_MSGRESULT, (LONG_PTR)FALSE );
				} 
				break;

				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( hDlgBugReport, DWLP_USER );
					iCurSel = TabCtrl_GetCurSel( ((LPNMHDR)lParam)-&gt;hwndFrom );

					if((iCurSel &gt;= 0) &amp;&amp; (iCurSel &lt;= 6))
						ShowWindow( phDlg[iCurSel], SW_SHOW );
				}
                break;

				default:
					return FALSE;
             }
		}
		break;

		case WM_NCDESTROY:
		{
			phDlg = (HWND*)GetWindowLongPtr( hDlgBugReport, DWLP_USER);
			delete [] phDlg;
		}
		break;
</code></pre>
<p>Hoffe ihr könnt den Fehler finden.</p>
<p>MfG<br />
yogle</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/152789/tabcontrol-problem</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 18:45:29 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/152789.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 09 Jul 2006 23:15:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Tabcontrol Problem on Sun, 09 Jul 2006 23:15:25 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich komm absolut nicht weiter. Hab meinem Programm jetzt ein Tabcontrol verpasst aber die Tabs tuen nicht so wie sie sollen. Wenn ich den Tab Register direkt anwähle erscheint nicht<br />
(norm. sollte eine kleine Liste angezeigt werden). Erst nachdem ich die Tabs Stack dump *und* Disassembler angewählt habe wird die Liste im Tab Register angezeigt.</p>
<p>Hier mal ein Codeausschnitt:</p>
<pre><code class="language-cpp">HWND	*phDlg;
INT		iCurSel	= 0;
TCITEM	item;
HWND	hWndTemp;
RECT	rc;

case WM_INITDIALOG:	
		{
			memset( &amp;item, 0, sizeof(item));

			hWndTemp = GetDlgItem( hDlgBugReport, IDC_TAB );
			if( hWndTemp == NULL )
			{
				#ifdef MYDBG
				MessageBoxA( NULL, &quot;Fehler GetDlgItem IDC_TAB&quot;, &quot;Fehler&quot;, MB_OK );
				#endif
				return FALSE;
			}

			item.mask  = TCIF_TEXT;

			// Tabs aufbauen
			item.pszText = L&quot;General&quot;;
            TabCtrl_InsertItem( hWndTemp, 0, &amp;item );

			item.pszText = L&quot;Processes&quot;;
            TabCtrl_InsertItem( hWndTemp, 1, &amp;item );

			item.pszText = L&quot;Modules&quot;;
            TabCtrl_InsertItem( hWndTemp, 2, &amp;item );

			item.pszText = L&quot;Call Stack&quot;;
            TabCtrl_InsertItem( hWndTemp, 3, &amp;item );

			item.pszText = L&quot;Registers&quot;;
            TabCtrl_InsertItem( hWndTemp, 4, &amp;item );

			item.pszText = L&quot;Stack dump&quot;;
            TabCtrl_InsertItem( hWndTemp, 5, &amp;item );

			item.pszText = L&quot;Disassembler&quot;;
            TabCtrl_InsertItem( hWndTemp, 6, &amp;item );

			// Dialoge, die im TabCtrl erscheienen sollen, erzeugen
			phDlg    = new HWND[7];
			phDlg[0] = CreateDialog( NULL, MAKEINTRESOURCE(IDD_TABDEFAULT), hDlgBugReport, TabGeneralProc );
			phDlg[1] = CreateDialog( NULL, MAKEINTRESOURCE(IDD_TABDEFAULT), hDlgBugReport, TabProcessesProc );
			phDlg[2] = CreateDialog( NULL, MAKEINTRESOURCE(IDD_TABDEFAULT), hDlgBugReport, TabModulesProc );
			phDlg[3] = CreateDialog( NULL, MAKEINTRESOURCE(IDD_TABDEFAULT), hDlgBugReport, TabCallStackProc );
			phDlg[4] = CreateDialog( NULL, MAKEINTRESOURCE(IDD_TABDEFAULT), hDlgBugReport, TabRegistersProc );
			phDlg[5] = CreateDialog( NULL, MAKEINTRESOURCE(IDD_TABDEFAULT), hDlgBugReport, TabStackDumpProc );
			phDlg[6] = CreateDialog( NULL, MAKEINTRESOURCE(IDD_TABDEFAULT), hDlgBugReport, TabDisassemblerProc );

			// 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.
			//for(int i=0;i&lt;7;i++)
			/*{
				BringWindowToTop( phDlg[6] );
				BringWindowToTop( phDlg[5] );
				BringWindowToTop( phDlg[4] );
				BringWindowToTop( phDlg[3] );
				BringWindowToTop( phDlg[2] );
				BringWindowToTop( phDlg[1] );
				BringWindowToTop( phDlg[0] );
			//}*/

			// Handles der Child-Dialoge speichern
			SetWindowLongPtr( hDlgBugReport, DWLP_USER, (LONG_PTR)phDlg );

			// Da sich der Dialog in der Groesse nicht verändern laesst,
			// muss die Grössenanpassung der Child-Dialoge bereits hier
			// erfolgen             
			GetWindowRect( hWndTemp, &amp;rc );
			ScreenToClient( hDlgBugReport, (LPPOINT)&amp;rc.left );
			ScreenToClient( hDlgBugReport, (LPPOINT)&amp;rc.right );
			SendMessage( hWndTemp, TCM_ADJUSTRECT, (WPARAM)FALSE, (LPARAM)&amp;rc );
			for(int i=0;i&lt;7;i++)
			{
				MoveWindow( phDlg[i], rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE );
			}
		}
		break;

		case WM_NOTIFY:
		{
			switch(((LPNMHDR)lParam)-&gt;code)
			{	
				case TCN_SELCHANGING:
				{  
					// Diese Notification wird gesendet, *bevor* das TabCtrl
					// die Auswahl ändert. Das ist ein guter Zeitpunkt, um
					// den zurzeit angezeigten Dialog zu verstecken
					phDlg   = (HWND*)GetWindowLongPtr( hDlgBugReport, DWLP_USER );
					iCurSel = TabCtrl_GetCurSel( ((LPNMHDR)lParam)-&gt;hwndFrom );

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

					SetWindowLongPtr( hDlgBugReport, DWLP_MSGRESULT, (LONG_PTR)FALSE );
				} 
				break;

				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( hDlgBugReport, DWLP_USER );
					iCurSel = TabCtrl_GetCurSel( ((LPNMHDR)lParam)-&gt;hwndFrom );

					if((iCurSel &gt;= 0) &amp;&amp; (iCurSel &lt;= 6))
						ShowWindow( phDlg[iCurSel], SW_SHOW );
				}
                break;

				default:
					return FALSE;
             }
		}
		break;

		case WM_NCDESTROY:
		{
			phDlg = (HWND*)GetWindowLongPtr( hDlgBugReport, DWLP_USER);
			delete [] phDlg;
		}
		break;
</code></pre>
<p>Hoffe ihr könnt den Fehler finden.</p>
<p>MfG<br />
yogle</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1094745</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1094745</guid><dc:creator><![CDATA[yogle]]></dc:creator><pubDate>Sun, 09 Jul 2006 23:15:25 GMT</pubDate></item><item><title><![CDATA[Reply to Tabcontrol Problem on Mon, 10 Jul 2006 06:01:25 GMT]]></title><description><![CDATA[<p>Der Code scheint in Ordnung zu sein, ich benutze den selben (wohl die gleiche Quelle). Allerdings wundert mich, dass du die gleiche Ressource für alle Tabs benutzt? Willst du nicht auf jedem Tab andere Steuerelemente usw. plazieren?</p>
<pre><code>MAKEINTRESOURCE(IDD_TABDEFAULT)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1094783</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1094783</guid><dc:creator><![CDATA[nichtswisser]]></dc:creator><pubDate>Mon, 10 Jul 2006 06:01:25 GMT</pubDate></item><item><title><![CDATA[Reply to Tabcontrol Problem on Mon, 10 Jul 2006 08:52:24 GMT]]></title><description><![CDATA[<p>Hallo nichtswisser,</p>
<p>ich hab meinen Code praktisch von <a href="http://winapi.net" rel="nofollow">winapi.net</a> abgeschrieben <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="😃"
    /><br />
Das ich jedes mal die gleiche Resource nutze ist schon richtig. Es besteht nur aus dem Tab und einem SysListView32 das ich dann bei jedem Tab mit anderen Werten fülle.<br />
Ich weiß nicht ob es euch hilft, aber hier mal die Styles für das SysTabControl32 und die Tabs:</p>
<p>SysTabControl32:</p>
<pre><code class="language-cpp">WS_TABSTOP
</code></pre>
<p>Tabs:</p>
<pre><code class="language-cpp">DS_SETFONT | WS_CHILD | WS_VISIBLE
WS_EX_CONTROLPARENT
</code></pre>
<p>Kann es vl. daran liegen, dass ich noch die WindowToTop Funktionen aufrufen muss? Im Beispiel macht er es in umgekehrter Reihenfolge wie er die Dialoge erstellt hatt.<br />
Bei mir scheint das aber nichts zu ändern. Ich erzeuge aus einem Dialog heraus über DialogBoxParam den Dialog mit dem Tabcontrol, hat das irgendwelche Auswirkungen?</p>
<p>MfG<br />
yogle</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1094872</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1094872</guid><dc:creator><![CDATA[yogle]]></dc:creator><pubDate>Mon, 10 Jul 2006 08:52:24 GMT</pubDate></item><item><title><![CDATA[Reply to Tabcontrol Problem on Mon, 10 Jul 2006 09:07:16 GMT]]></title><description><![CDATA[<p>Oh man! Einen ganzen Tag für so ein Dreck verschwendet <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /><br />
Hab das Problem jetzt gefunden. Bei den Tabs darf nicht der</p>
<pre><code class="language-cpp">WS_VISIBLE
</code></pre>
<p>Style aktiviert sei, sonst liegen die zuletz erzeugten Dialoge über dem benötigten Tab.</p>
<p>Trotzdem danke fürs Gedankenanregen <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>
<p>MfG<br />
yogle</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1094887</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1094887</guid><dc:creator><![CDATA[yogle]]></dc:creator><pubDate>Mon, 10 Jul 2006 09:07:16 GMT</pubDate></item></channel></rss>