<?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[Editfeld, Text ändert sich bei Eingabe nicht]]></title><description><![CDATA[<p>Hi,</p>
<p>ich habe zwei ganz normale Fenster, wobei Fenster 2 ein Child von Fenster1 ist und ein Editfeld in Fenster2 liegt. Wenn ich dann in das Editfeld klicke ändert sich der Text darin leider nicht. <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 />
Wenn ich das Editfeld in Fenster1 platziere läuft alles wunderbar, oder aber, wenn ich bei Fenster2 das Style WS_CAPTION weglasse, dann funzt es auch.</p>
<p>Hier der Testcode von mir (Auszug):</p>
<pre><code class="language-cpp">...
hWnd  = CreateWindow(szAppName, &quot;Titelleiste&quot;, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, 0, 0);
hWnd2 = CreateWindow(szAppName2, &quot;Fenster 02&quot;, WS_CHILD, 200, 200, 200, 200, hWnd, 0, 0, 0);
hEdt  = CreateWindowEx(WS_EX_CLIENTEDGE, &quot;Edit&quot;, &quot;Editfeld&quot;, WS_CHILD | WS_VISIBLE, 100, 100, 100, 25, hWnd2, 0, 0, 0);
...
</code></pre>
<p>der Rest ist aus nem Standard-WinAPI-Tutorial, wo man sein erstes eigenes Fenster erstellt. <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>Wie gesagt, so läuft es, aber sobald ich bei Fenster2 ein WS_CAPTION hinzunehme, ändert sich der Text nicht mehr. <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="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/112865/editfeld-text-ändert-sich-bei-eingabe-nicht</link><generator>RSS for Node</generator><lastBuildDate>Wed, 01 Jul 2026 09:48:29 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/112865.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 17 Jun 2005 08:26:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Editfeld, Text ändert sich bei Eingabe nicht on Fri, 17 Jun 2005 08:26:50 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich habe zwei ganz normale Fenster, wobei Fenster 2 ein Child von Fenster1 ist und ein Editfeld in Fenster2 liegt. Wenn ich dann in das Editfeld klicke ändert sich der Text darin leider nicht. <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 />
Wenn ich das Editfeld in Fenster1 platziere läuft alles wunderbar, oder aber, wenn ich bei Fenster2 das Style WS_CAPTION weglasse, dann funzt es auch.</p>
<p>Hier der Testcode von mir (Auszug):</p>
<pre><code class="language-cpp">...
hWnd  = CreateWindow(szAppName, &quot;Titelleiste&quot;, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, 0, 0);
hWnd2 = CreateWindow(szAppName2, &quot;Fenster 02&quot;, WS_CHILD, 200, 200, 200, 200, hWnd, 0, 0, 0);
hEdt  = CreateWindowEx(WS_EX_CLIENTEDGE, &quot;Edit&quot;, &quot;Editfeld&quot;, WS_CHILD | WS_VISIBLE, 100, 100, 100, 25, hWnd2, 0, 0, 0);
...
</code></pre>
<p>der Rest ist aus nem Standard-WinAPI-Tutorial, wo man sein erstes eigenes Fenster erstellt. <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>Wie gesagt, so läuft es, aber sobald ich bei Fenster2 ein WS_CAPTION hinzunehme, ändert sich der Text nicht mehr. <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="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/810941</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/810941</guid><dc:creator><![CDATA[mantiz]]></dc:creator><pubDate>Fri, 17 Jun 2005 08:26:50 GMT</pubDate></item><item><title><![CDATA[Reply to Editfeld, Text ändert sich bei Eingabe nicht on Fri, 17 Jun 2005 13:01:48 GMT]]></title><description><![CDATA[<p>Messages gehen immer an das Parent-Fenster. Sprich du musst auf Nachrichten für das Edit in der WndProc von deinem zweiten Fenster reagieren. Wenn dies auch ein Controll ist (Groupbox, etc.) dann musst du es wohl subclassen und dessen standard WndProc auf deine umbiegen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/811184</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/811184</guid><dc:creator><![CDATA[[[global:former_user]]]]></dc:creator><pubDate>Fri, 17 Jun 2005 13:01:48 GMT</pubDate></item><item><title><![CDATA[Reply to Editfeld, Text ändert sich bei Eingabe nicht on Fri, 17 Jun 2005 13:03:05 GMT]]></title><description><![CDATA[<blockquote>
<p>Controll</p>
</blockquote>
<p>wohl zu viel getrollt <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/811186</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/811186</guid><dc:creator><![CDATA[controL]]></dc:creator><pubDate>Fri, 17 Jun 2005 13:03:05 GMT</pubDate></item><item><title><![CDATA[Reply to Editfeld, Text ändert sich bei Eingabe nicht on Fri, 17 Jun 2005 13:45:32 GMT]]></title><description><![CDATA[<p>hm, ich glaube nicht, dass es irgendwas damit zu tun hat. Wie gesagt, wenn ich die 3 &quot;Fenster&quot; so aufrufe, wie ich es geschrieben habe, dann läuft alles super, aber wenn ich beim Aufruf von &quot;Fenster 02&quot; zu dem WS_CHILD und ein WS_CAPTION dazu-oder, dann funzt es nicht mehr. Window-Proc, etc. bleibt alles gleich, nur das eine WS_CAPTION kommt dazu.</p>
<p>Oder behandelt Windows das &quot;Fenster 02&quot; nicht als Fenster, wenn es kein WS_CAPTION hat, sondern als Static-Control, welches die Nachrichten dann weiter an das Parent sendet, aber mit WS_CAPTION halt nicht ?</p>
<p>bzw: Müssen Nachrichten, die von einem Edit-Control kommen nicht direkt an das Parent gesendet, sondern an das oberste Parent gesendet werden?</p>
<p>Wie gesagt, die beiden Fenster haben die gleiche Wndproc, ich steh glaub ich voll auf dem Schlauch. <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="😞"
    /></p>
<p>Hier nochmal der gesamte Code:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

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

const char szAppName[] = &quot;Ein eigenes Fenster&quot;;
const char szAppName2[] = &quot;Ein eigenes Fenster2&quot;;

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) {
	HWND       hWnd, hWnd2, hEdt;
	MSG        msg;
	WNDCLASS   wc, wc2;

	wc.style         =  CS_HREDRAW | CS_VREDRAW;
	wc.lpfnWndProc   =  WndProc;
	wc.cbClsExtra    =  0;
	wc.cbWndExtra    =  0;
	wc.hInstance     =  hInstance;
	wc.hCursor       =  LoadCursor(NULL,IDC_ARROW);
	wc.hIcon         =  LoadIcon(NULL,IDI_APPLICATION);
	wc.hbrBackground =  (HBRUSH)GetStockObject(WHITE_BRUSH);
	wc.lpszClassName =  szAppName;
	wc.lpszMenuName  =  NULL;

	RegisterClass(&amp;wc);

	wc2.style         =  CS_HREDRAW | CS_VREDRAW;
	wc2.lpfnWndProc   =  WndProc;
	wc2.cbClsExtra    =  0;
	wc2.cbWndExtra    =  0;
	wc2.hInstance     =  hInstance;
	wc2.hCursor       =  LoadCursor(NULL,IDC_ARROW);
	wc2.hIcon         =  LoadIcon(NULL,IDI_APPLICATION);
	wc2.hbrBackground =  (HBRUSH)GetStockObject(GRAY_BRUSH);
	wc2.lpszClassName =  szAppName2;
	wc2.lpszMenuName  =  NULL;

	RegisterClass(&amp;wc2);

	hWnd  = CreateWindow(szAppName, &quot;Titelleiste&quot;, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, 0, 0);
	hWnd2 = CreateWindow(szAppName2, &quot;Fenster 02&quot;, WS_CHILD, 200, 200, 200, 200, hWnd, 0, 0, 0);
	hEdt  = CreateWindowEx(WS_EX_CLIENTEDGE, &quot;Edit&quot;, &quot;Editfeld&quot;, WS_CHILD | WS_VISIBLE, 100, 100, 100, 25, hWnd2, 0, 0, 0);

	ShowWindow(hWnd, iCmdShow);
	UpdateWindow(hWnd);
	ShowWindow(hWnd2, iCmdShow);
	UpdateWindow(hWnd2);

	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_DESTROY: {
			PostQuitMessage(0);
			return 0;
		}
	}

	return DefWindowProc(hWnd, message, wParam, lParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/811227</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/811227</guid><dc:creator><![CDATA[mantiz]]></dc:creator><pubDate>Fri, 17 Jun 2005 13:45:32 GMT</pubDate></item></channel></rss>