<?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[Hilfe bei Editbox]]></title><description><![CDATA[<p>Ich hab die suche auch schon benutzt aber nichts für mich gefunden. Ich bin schon verzweifelt.<br />
Ich bin in WInAPI ein noob und hab ein Problem mit dem Editbox, er ist in ein neuen fenster und das will ich nicht. Wie geht dass das Editbox in mein fenster drinnen ist wo auch der Button ist?</p>
<pre><code>#include &lt;windows.h&gt;

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

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

   const char szAppName[]  = &quot;Windows Buttons&quot;;

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

   RegisterClass(&amp;wc);

   hWnd = CreateWindow(    szAppName,
                           szAppName,
                           WS_OVERLAPPEDWINDOW|WS_SYSMENU,
                           CW_USEDEFAULT,
                           CW_USEDEFAULT,
                           CW_USEDEFAULT,
                           CW_USEDEFAULT,
                           NULL,
                           NULL,
                           hInstance,
                           NULL);

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

   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)
{
	static HWND hButton,hEdit;
   int frage;

   switch (message)
   {
   case WM_CREATE:
      {
		  hButton = CreateWindow(  &quot;button&quot;,
                                  &quot;Beenden&quot;,
                                  WS_CHILD | WS_VISIBLE,
                                  0, 0, 0, 0,
                                  hWnd,
                                  NULL,
                                  ((LPCREATESTRUCT) lParam) -&gt; hInstance,
                                  NULL);
		  hWnd=CreateWindow(&quot;edit&quot;,&quot;Text hier eingeben&quot;,
			  WS_VISIBLE|WS_VSCROLL|ES_MULTILINE,
			  CW_USEDEFAULT,CW_USEDEFAULT,200,200,
			  hWnd,NULL,
			  ((LPCREATESTRUCT) lParam) -&gt;hInstance,NULL);

         return 0;
      }
   case WM_SIZE:
      {
		  MoveWindow(hButton, LOWORD(lParam) / 2 - 80, HIWORD(lParam) - 30, 
                                                           160, 22, TRUE);
         return 0;
      }
	  case WM_COMMAND:
      {
         if (lParam == (LPARAM)hButton)
         {
            if (HIWORD(wParam) == BN_CLICKED)
               frage=MessageBox(hWnd,&quot;Wirklich beenden?&quot;,&quot;Frage&quot;,MB_ICONINFORMATION|MB_YESNO);
			if(frage==IDYES)
				SendMessage(hWnd, WM_CLOSE, 0, 0);
         }
         return 0;
      }
   case WM_DESTROY:
      {
         PostQuitMessage(0);
         return 0;
      }
   }
   return DefWindowProc(hWnd, message, wParam, lParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/128542/hilfe-bei-editbox</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 02:46:42 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/128542.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 04 Dec 2005 19:17:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hilfe bei Editbox on Sun, 04 Dec 2005 19:17:25 GMT]]></title><description><![CDATA[<p>Ich hab die suche auch schon benutzt aber nichts für mich gefunden. Ich bin schon verzweifelt.<br />
Ich bin in WInAPI ein noob und hab ein Problem mit dem Editbox, er ist in ein neuen fenster und das will ich nicht. Wie geht dass das Editbox in mein fenster drinnen ist wo auch der Button ist?</p>
<pre><code>#include &lt;windows.h&gt;

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

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

   const char szAppName[]  = &quot;Windows Buttons&quot;;

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

   RegisterClass(&amp;wc);

   hWnd = CreateWindow(    szAppName,
                           szAppName,
                           WS_OVERLAPPEDWINDOW|WS_SYSMENU,
                           CW_USEDEFAULT,
                           CW_USEDEFAULT,
                           CW_USEDEFAULT,
                           CW_USEDEFAULT,
                           NULL,
                           NULL,
                           hInstance,
                           NULL);

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

   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)
{
	static HWND hButton,hEdit;
   int frage;

   switch (message)
   {
   case WM_CREATE:
      {
		  hButton = CreateWindow(  &quot;button&quot;,
                                  &quot;Beenden&quot;,
                                  WS_CHILD | WS_VISIBLE,
                                  0, 0, 0, 0,
                                  hWnd,
                                  NULL,
                                  ((LPCREATESTRUCT) lParam) -&gt; hInstance,
                                  NULL);
		  hWnd=CreateWindow(&quot;edit&quot;,&quot;Text hier eingeben&quot;,
			  WS_VISIBLE|WS_VSCROLL|ES_MULTILINE,
			  CW_USEDEFAULT,CW_USEDEFAULT,200,200,
			  hWnd,NULL,
			  ((LPCREATESTRUCT) lParam) -&gt;hInstance,NULL);

         return 0;
      }
   case WM_SIZE:
      {
		  MoveWindow(hButton, LOWORD(lParam) / 2 - 80, HIWORD(lParam) - 30, 
                                                           160, 22, TRUE);
         return 0;
      }
	  case WM_COMMAND:
      {
         if (lParam == (LPARAM)hButton)
         {
            if (HIWORD(wParam) == BN_CLICKED)
               frage=MessageBox(hWnd,&quot;Wirklich beenden?&quot;,&quot;Frage&quot;,MB_ICONINFORMATION|MB_YESNO);
			if(frage==IDYES)
				SendMessage(hWnd, WM_CLOSE, 0, 0);
         }
         return 0;
      }
   case WM_DESTROY:
      {
         PostQuitMessage(0);
         return 0;
      }
   }
   return DefWindowProc(hWnd, message, wParam, lParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/934199</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/934199</guid><dc:creator><![CDATA[DarkShadow18]]></dc:creator><pubDate>Sun, 04 Dec 2005 19:17:25 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe bei Editbox on Sun, 04 Dec 2005 19:23:02 GMT]]></title><description><![CDATA[<p>Du solltes noch WS_CHILD angeben (wie beim Button).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/934220</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/934220</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Sun, 04 Dec 2005 19:23:02 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe bei Editbox on Sun, 04 Dec 2005 19:27:34 GMT]]></title><description><![CDATA[<p>ohh!<br />
Danke für die Hilfe!!!!!</p>
<p>Mit freundlichen Grüßen</p>
<p>Martin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/934226</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/934226</guid><dc:creator><![CDATA[DarkShadow18]]></dc:creator><pubDate>Sun, 04 Dec 2005 19:27:34 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe bei Editbox on Sun, 04 Dec 2005 21:18:44 GMT]]></title><description><![CDATA[<p>Ich hab da mal noch 2 Fragen.</p>
<p>1. meine Editbox schaut aus als ob es von der Windows Version 3.x oder so stammt. Sprich ohne Rand und nur ein weißer Streifen. Wie kann ich das ändern, und das der Chourser im ersten textfeld drinnen ist (beim Programmstart)</p>
<p>2. Wo ist der unterschied zwischen CreateWindow und CreateWindowEx? Ich hab schon oft Befehle gefunden wo ein Ex am Ende war.</p>
<p>Mit freundlichen Grüßen</p>
<p>Martin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/934464</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/934464</guid><dc:creator><![CDATA[DarkShadow18]]></dc:creator><pubDate>Sun, 04 Dec 2005 21:18:44 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe bei Editbox on Sun, 04 Dec 2005 21:49:58 GMT]]></title><description><![CDATA[<p>DarkShadow18 schrieb:</p>
<blockquote>
<p>1. meine Editbox schaut aus als ob es von der Windows Version 3.x oder so stammt. Sprich ohne Rand und nur ein weißer Streifen.</p>
</blockquote>
<p>Schau dir mal die (extended) window styles näher an <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>DarkShadow18 schrieb:</p>
<blockquote>
<p>Wie kann ich das ändern, und das der Chourser im ersten textfeld drinnen ist (beim Programmstart)</p>
</blockquote>
<p>SetFocus in WM_CREATE sollte helfen...</p>
<p>DarkShadow18 schrieb:</p>
<blockquote>
<p>2. Wo ist der unterschied zwischen CreateWindow und CreateWindowEx? Ich hab schon oft Befehle gefunden wo ein Ex am Ende war.</p>
</blockquote>
<p>Naja, die Varianten mit Ex sind eben Erweiterungen von alten Funktionen - in diesem Falle um noch einen <a href="http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/createwindowex.asp" rel="nofollow">extended window style</a> angeben zu können.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/934511</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/934511</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Sun, 04 Dec 2005 21:49:58 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe bei Editbox on Sun, 04 Dec 2005 21:51:52 GMT]]></title><description><![CDATA[<p>Das mit dem aussehen von der Editbox bin ich gerade drauf gekommen.</p>
<p>Aber danke für den hinweiß</p>
<p>Mit freundlichen Grüßen</p>
<p>Martin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/934515</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/934515</guid><dc:creator><![CDATA[DarkShadow18]]></dc:creator><pubDate>Sun, 04 Dec 2005 21:51:52 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe bei Editbox on Sun, 04 Dec 2005 22:24:17 GMT]]></title><description><![CDATA[<p>Bei mein Fenster hab ich den hintergrund grau. und wenn ich jetzt ein text hin schreibe dann ist der hintergrund vom text weiß kann ich das ändern?</p>
<pre><code class="language-cpp">case WM_PAINT:
		  {
			  PAINTSTRUCT ps;
			  HDC hDC;
			  const char vorname[]=&quot;Vorname:&quot;;
			  hDC=BeginPaint(hWnd,&amp;ps);
			  {
				  TextOut(hDC,50,55,vorname,sizeof(vorname)-1);
			  }
			  EndPaint(hWnd,&amp;ps);
			  return 0;
		  }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/934537</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/934537</guid><dc:creator><![CDATA[DarkShadow18]]></dc:creator><pubDate>Sun, 04 Dec 2005 22:24:17 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe bei Editbox on Mon, 05 Dec 2005 06:55:03 GMT]]></title><description><![CDATA[<p>Einfach nur die Doku lesen <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>
<blockquote>
<p>The TextOut function writes a character string at the specified location, using the currently selected font, background color, and text color.</p>
</blockquote>
<p>=&gt; SetBkColor</p>
]]></description><link>https://www.c-plusplus.net/forum/post/934612</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/934612</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Mon, 05 Dec 2005 06:55:03 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe bei Editbox on Mon, 05 Dec 2005 07:49:38 GMT]]></title><description><![CDATA[<p>danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/934645</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/934645</guid><dc:creator><![CDATA[DarkShadow18]]></dc:creator><pubDate>Mon, 05 Dec 2005 07:49:38 GMT</pubDate></item><item><title><![CDATA[Reply to Hilfe bei Editbox on Mon, 12 Dec 2005 11:34:15 GMT]]></title><description><![CDATA[<p>wolltest du das so:</p>
<pre><code class="language-cpp">hWnd=CreateWindow(&quot;edit&quot;,&quot;Text hier eingeben&quot;, 
              WS_VISIBLE|WS_VSCROLL|ES_MULTILINE, 
              CW_USEDEFAULT,CW_USEDEFAULT,200,200, 
              hWnd,NULL, 
              ((LPCREATESTRUCT) lParam) -&gt;hInstance,NULL);
</code></pre>
<p>oder sollte es so aussehen:</p>
<pre><code class="language-cpp">hEdit=CreateWindow(&quot;edit&quot;,&quot;Text hier eingeben&quot;, 
              WS_VISIBLE|WS_VSCROLL|ES_MULTILINE, 
              CW_USEDEFAULT,CW_USEDEFAULT,200,200, 
              hWnd,NULL, 
              ((LPCREATESTRUCT) lParam) -&gt;hInstance,NULL);
</code></pre>
<p>und wenn du hier noch was ergänzt:</p>
<pre><code class="language-cpp">case WM_SIZE:
      {
          MoveWindow(hButton, LOWORD(lParam) / 2 - 80, HIWORD(lParam) - 30, 
                                                           160, 22, TRUE);
          MoveWindow(hEdit, 10, 10, LOWORD(lParam) - 10, HIWORD(lParam) - 40,
                                                            TRUE);
         return 0;
      }
</code></pre>
<p>mfg f.-th.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/939707</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/939707</guid><dc:creator><![CDATA[f.-th.]]></dc:creator><pubDate>Mon, 12 Dec 2005 11:34:15 GMT</pubDate></item></channel></rss>