<?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[GetWindowText funktioniert beim 2. Knopfdruck nicht ! ???]]></title><description><![CDATA[<p>Hi,<br />
Ich habe folgendes Problem und finde die Ursache nicht:<br />
Wenn ich zum ersten mal auf meinen Knopf drücke funktioniert alles wie gewollt.<br />
Wenn ich jetzt aber nochmal draufdrücke passiert garnichts also lass ich mir mal den Variableninhalt per MessageBox() ausgeben und ich stelle fest: GetWindowText hat nicht gemacht was es sollte! Kann mir jemand sagen was ich falsch gemacht habe??</p>
<pre><code class="language-cpp">case WM_COMMAND:
switch(HIWORD(wParam))
{
case BN_CLICKED:		//Wenn auf Steuerelement geklickt wird 

GetWindowText(hwndWortArt,VOK.WortArt,40) ;
GetWindowText(hwndLAT,VOK.Lat,25);
GetWindowText(hwndGER,VOK.Ger,100);
GetWindowText(hwndInfo,VOK.Info,1000);    // in das Fenster wurde geschrieben!
MessageBox(hwnd,LPTSTR(VOK.lpWortArt),NULL,NULL);
// Weiterer Quelltext

Reset() ;    // Stellt alle gebrauchten Variablen auf NULL 
}
return 0;
</code></pre>
<p>die Struktur sieht so aus:</p>
<pre><code class="language-cpp">static struct
{
	TCHAR WortArt[40] ;
	LPTSTR lpWortArt ;

	TCHAR Lat[25] ;
	LPTSTR lpLat ;

	TCHAR Ger[100] ;
	LPTSTR lpGer ;

	TCHAR Info[1000] ;
	LPTSTR lpInfo ;

	TCHAR Genus[1] ;
	TCHAR Deklination[2] ;
	TCHAR Stamm[20] ;
	LPTSTR lpStamm ;

}VOK;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/180357/getwindowtext-funktioniert-beim-2-knopfdruck-nicht</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Jul 2026 05:25:36 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/180357.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 01 May 2007 18:01:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to GetWindowText funktioniert beim 2. Knopfdruck nicht ! ??? on Tue, 01 May 2007 18:01:30 GMT]]></title><description><![CDATA[<p>Hi,<br />
Ich habe folgendes Problem und finde die Ursache nicht:<br />
Wenn ich zum ersten mal auf meinen Knopf drücke funktioniert alles wie gewollt.<br />
Wenn ich jetzt aber nochmal draufdrücke passiert garnichts also lass ich mir mal den Variableninhalt per MessageBox() ausgeben und ich stelle fest: GetWindowText hat nicht gemacht was es sollte! Kann mir jemand sagen was ich falsch gemacht habe??</p>
<pre><code class="language-cpp">case WM_COMMAND:
switch(HIWORD(wParam))
{
case BN_CLICKED:		//Wenn auf Steuerelement geklickt wird 

GetWindowText(hwndWortArt,VOK.WortArt,40) ;
GetWindowText(hwndLAT,VOK.Lat,25);
GetWindowText(hwndGER,VOK.Ger,100);
GetWindowText(hwndInfo,VOK.Info,1000);    // in das Fenster wurde geschrieben!
MessageBox(hwnd,LPTSTR(VOK.lpWortArt),NULL,NULL);
// Weiterer Quelltext

Reset() ;    // Stellt alle gebrauchten Variablen auf NULL 
}
return 0;
</code></pre>
<p>die Struktur sieht so aus:</p>
<pre><code class="language-cpp">static struct
{
	TCHAR WortArt[40] ;
	LPTSTR lpWortArt ;

	TCHAR Lat[25] ;
	LPTSTR lpLat ;

	TCHAR Ger[100] ;
	LPTSTR lpGer ;

	TCHAR Info[1000] ;
	LPTSTR lpInfo ;

	TCHAR Genus[1] ;
	TCHAR Deklination[2] ;
	TCHAR Stamm[20] ;
	LPTSTR lpStamm ;

}VOK;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1277106</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1277106</guid><dc:creator><![CDATA[noha_391]]></dc:creator><pubDate>Tue, 01 May 2007 18:01:30 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowText funktioniert beim 2. Knopfdruck nicht ! ??? on Tue, 01 May 2007 18:55:06 GMT]]></title><description><![CDATA[<p>Ist dir klar, dass der Zeiger lpWortArt nichts mit dem Array WortArt zu tun hat? Wozu überhaupt die Zeiger?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1277145</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1277145</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Tue, 01 May 2007 18:55:06 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowText funktioniert beim 2. Knopfdruck nicht ! ??? on Wed, 02 May 2007 07:52:14 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-403.html" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-4.html" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1277315</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1277315</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Wed, 02 May 2007 07:52:14 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowText funktioniert beim 2. Knopfdruck nicht ! ??? on Wed, 02 May 2007 18:58:37 GMT]]></title><description><![CDATA[<p>Der Zeiger lpWortArt zeigt auf das Array WortArt (damit ich nicht ständig cast-operatoren verwenden muss)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1277802</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1277802</guid><dc:creator><![CDATA[noha_39]]></dc:creator><pubDate>Wed, 02 May 2007 18:58:37 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowText funktioniert beim 2. Knopfdruck nicht ! ??? on Wed, 02 May 2007 19:17:22 GMT]]></title><description><![CDATA[<p>noha_39 schrieb:</p>
<blockquote>
<p>Der Zeiger lpWortArt zeigt auf das Array WortArt</p>
</blockquote>
<p>Sorgst du dafür? Ist dir klar, was passiert, wenn du in WortArt mehr als 39 Zeichen reinschreibst?</p>
<blockquote>
<p>(damit ich nicht ständig cast-operatoren verwenden muss)</p>
</blockquote>
<p>Musst du doch gar nicht. Du kannst WortArt selbst als Zeiger auf das erste Element des Arrays benutzen. Die zusätzlichen Zeiger brauchst du nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1277809</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1277809</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Wed, 02 May 2007 19:17:22 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowText funktioniert beim 2. Knopfdruck nicht ! ??? on Thu, 03 May 2007 15:20:19 GMT]]></title><description><![CDATA[<p>Ich sorg dafür das der Zeiger immer neu auf WortArt gesetzt wird:</p>
<pre><code class="language-cpp">VOID Reset()
{
	int i;

	for( i=0 ; i&lt;41 ; i++ )
	{
	VOK.WortArt[i] = NULL ;
	}

	VOK.lpWortArt = VOK.WortArt ;

	for( i=0 ; i&lt;21 ; i++ )
	{
		VOK.Stamm[i] = NULL ;
	}

	VOK.lpStamm = VOK.Stamm ;

	for (i=0; i&gt;1001 ; i++ )
	{
		VOK.Info[i] = NULL ;
	}

	VOK.lpInfo = VOK.Info ;
}
</code></pre>
<p>und es werden auch nicht mehr als 39 Zeichen reingeschrieben(wird nicht benötigt)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1278194</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278194</guid><dc:creator><![CDATA[noha_39]]></dc:creator><pubDate>Thu, 03 May 2007 15:20:19 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowText funktioniert beim 2. Knopfdruck nicht ! ??? on Thu, 03 May 2007 15:47:35 GMT]]></title><description><![CDATA[<p>noha_39 schrieb:</p>
<blockquote>
<p>und es werden auch nicht mehr als 39 Zeichen reingeschrieben.</p>
</blockquote>
<p>Doch. Deine Reset-Funktion beispielsweise schreibt 41 Zeichen in WortArt. Der letzte gültige Index ist WortArt[39], du greifst in deiner Schleife aber auf WortArt[40] zu, gleiches gilt für Stamm und Info. Das ist möglicherweise schon Speicher, der zum nachfolgenden Zeiger gehört. In dieser Funktion macht das vermutlich nichts, weil du die Zeiger danach setzt. Aber wenn du ähnlich kaputte Schleifen auch an anderer Stelle hast, kann das schon ordentlich in die Hose gehen.</p>
<p>Aber wie gesagt, die Zeiger brauchst du gar nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1278205</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278205</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Thu, 03 May 2007 15:47:35 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowText funktioniert beim 2. Knopfdruck nicht ! ??? on Thu, 03 May 2007 16:00:09 GMT]]></title><description><![CDATA[<p>Gut ich habe alles überprüft ,ich habe garkeine anderen Schleifen also auch keine &quot;kaputten&quot; damit wäre mein Problem also noch nicht gelöst trotzdem Danke schonmal für die Bemühungen (ich schäme mich schon für den Schleifenfehler) <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/1278213</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278213</guid><dc:creator><![CDATA[noha_39]]></dc:creator><pubDate>Thu, 03 May 2007 16:00:09 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowText funktioniert beim 2. Knopfdruck nicht ! ??? on Thu, 03 May 2007 16:24:23 GMT]]></title><description><![CDATA[<p>Prüf doch mal mit dem Debugger, wohin lpWortArt an dieser Stelle wirklich zeigt. Oder gib einfach mal WortArt in der MessageBox aus, das funktioniert ohne irgendeinen Cast.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1278229</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278229</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Thu, 03 May 2007 16:24:23 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowText funktioniert beim 2. Knopfdruck nicht ! ??? on Thu, 03 May 2007 16:54:36 GMT]]></title><description><![CDATA[<p>Das mit der MessageBox() habe ich ja gemacht und da zeigt die Message Box nichts an (hab auch die &quot;eben neu erlernte&quot; Schreibweise benutzt)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1278244</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278244</guid><dc:creator><![CDATA[noha_39]]></dc:creator><pubDate>Thu, 03 May 2007 16:54:36 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowText funktioniert beim 2. Knopfdruck nicht ! ??? on Thu, 03 May 2007 17:04:19 GMT]]></title><description><![CDATA[<p>Hmm zeig mal bitte deinen kompletten Source ... da sind wahrscheinlich so einige Fehler drin. Damit du wenigstens ne anständige Basis hast um anzufangen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1278255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278255</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Thu, 03 May 2007 17:04:19 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowText funktioniert beim 2. Knopfdruck nicht ! ??? on Thu, 03 May 2007 17:07:16 GMT]]></title><description><![CDATA[<p>Im Debug Modus scheint alles zu funktionieren! -&gt; find das sehr komisch<br />
da hab ich nur festgestellt das was anderes von mir falsch gemacht wurde (bin mir sehr sicher das das nichts damit zu tun hat)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1278259</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278259</guid><dc:creator><![CDATA[noha_39]]></dc:creator><pubDate>Thu, 03 May 2007 17:07:16 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowText funktioniert beim 2. Knopfdruck nicht ! ??? on Thu, 03 May 2007 17:09:47 GMT]]></title><description><![CDATA[<p>Code sieht so aus (weis das das noch optimierungsbedürftig ist)</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &quot;Vokabler.h&quot;

#define ID_EDIT1 1
#define ID_EDIT2 2
#define ID_EDIT3 3
#define ID_EDIT4 4

static struct
{
	TCHAR WortArt[40] ;
	LPTSTR lpWortArt ;

	TCHAR Lat[25] ;
	LPTSTR lpLat ;

	TCHAR Ger[100] ;
	LPTSTR lpGer ;

	TCHAR Info[1000] ;
	LPTSTR lpInfo ;

	TCHAR Genus[1] ;
	TCHAR Deklination[2] ;
	TCHAR Stamm[20] ;
	LPTSTR lpStamm ;

}VOK;

/*  Declare Window procedure  */
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
VOID Reset() ;

static TCHAR szAppName[] = TEXT (&quot;Vokabler 3.0&quot;) ;		// Anwendungsname

// Main Funktion des Programms
int WINAPI WinMain (HINSTANCE hInstance,
                    HINSTANCE hPrevInstance,
                    PSTR szCmdLine,
                    int iCmdShow)
{
    HWND hwnd;               /* This is the handle for our window */
    MSG msg;                 /* Here messages to the application are saved */
    WNDCLASS wndclass;       /* Data structure for the windowclass */

    /* The Window structure */
    wndclass.hInstance = hInstance;
    wndclass.lpszClassName = szAppName;
    wndclass.lpfnWndProc = WndProc;                           /* This function is called by windows */
    wndclass.style = CS_HREDRAW | CS_VREDRAW;                 /* Catch double-clicks */
    wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION);
    wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
    wndclass.lpszMenuName = NULL;                 
    wndclass.cbClsExtra = 0;                      
    wndclass.cbWndExtra = 0;                      
    wndclass.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);

    /* Register the window class, and if it fails quit the program */
    if (!RegisterClass (&amp;wndclass))
        {
                 MessageBox (NULL, TEXT (&quot;Dieses Programm erfordert Windows NT 5.0, Windows XP oder höher&quot;), szAppName, MB_ICONERROR) ;
                 return 0;
        }

    /* The class is registered, let's create the program*/
    hwnd = CreateWindow (szAppName,              /* Classname */
           TEXT (&quot;Übersetzer&quot;),    /* Title Text */
           WS_OVERLAPPEDWINDOW,                  /* default window */
           CW_USEDEFAULT,                        /* Windows decides the position */
           CW_USEDEFAULT,                        /* where the window ends up on the screen */
           900,                        /* The programs width */
           200,                        /* and height in pixels */
           NULL,                                 /* The window is a child-window to desktop */
           NULL,                                 /* No menu */
           hInstance,                            /* Program Instance handler */
           NULL                                  /* No Window Creation data */
           );

    /* Make the window visible on the screen */
    ShowWindow (hwnd, iCmdShow);
    UpdateWindow (hwnd);

    /* Run the message loop. It will run until GetMessage() returns 0 */
    while (GetMessage (&amp;msg, NULL, 0, 0))
    {
        /* Translate virtual-key messages into character messages */
        TranslateMessage(&amp;msg);
        /* Send message to WindowProcedure */
        DispatchMessage(&amp;msg);
    }
    return msg.wParam;
}

VOID Reset()
{
	int i;

	for( i=0 ; i&lt;41 ; i++ )
	{
	VOK.WortArt[i] = NULL ;
	}

	VOK.lpWortArt = VOK.WortArt ;

	for( i=0 ; i&lt;21 ; i++ )
	{
		VOK.Stamm[i] = NULL ;
	}

	VOK.lpStamm = VOK.Stamm ;

	for (i=0; i&gt;1001 ; i++ )
	{
		VOK.Info[i] = NULL ;
	}

	VOK.lpInfo = VOK.Info ;
}

// Window Prozedur
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
		// Variablen für WM_PAINT
        HDC hdc;
        PAINTSTRUCT ps;
        RECT rect ; 

		// Variablen für Steuerelemente
        static HWND hwndLAT, hwndGER, hwndWortArt, hwndInfo, hwndButton ;

		int i=0;

    switch (message)                  /* handle the messages */
    {

        case WM_CREATE:
             hwndLAT= CreateWindow (TEXT (&quot;edit&quot;), NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL , 100, 13, 200, 100, hwnd, (HMENU) ID_EDIT1,((LPCREATESTRUCT) lParam)-&gt; hInstance, NULL) ;
			 hwndGER= CreateWindow ( TEXT(&quot;edit&quot;),NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL  ,45,45,100,40,hwnd,(HMENU) ID_EDIT2,((LPCREATESTRUCT) lParam)-&gt; hInstance, NULL) ;
			 hwndWortArt= CreateWindow ( TEXT(&quot;edit&quot;),NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL ,45,100,300,20,hwnd,(HMENU) ID_EDIT3,((LPCREATESTRUCT) lParam)-&gt; hInstance, NULL) ;
			 hwndInfo = CreateWindow ( TEXT(&quot;edit&quot;),NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL ,45,100,300,20,hwnd,(HMENU) ID_EDIT4,((LPCREATESTRUCT) lParam)-&gt; hInstance, NULL) ;
			 hwndButton = CreateWindow ( TEXT(&quot;button&quot;),TEXT(&quot;N E X T  -&gt;&quot;), WS_CHILD | WS_VISIBLE ,45,45,100,40,hwnd,(HMENU) 1,((LPCREATESTRUCT) lParam)-&gt; hInstance, NULL) ;
			 Reset() ;
			 return 0;

		case WM_SIZE:
             MoveWindow (hwndLAT, 45, 10, 200, 20 ,TRUE) ;
			 MoveWindow (hwndGER, 45, 45, 200, 20 ,TRUE) ;
			 MoveWindow (hwndWortArt, 45, 80, 200, 20 ,TRUE) ;
			 MoveWindow (hwndInfo,45,115,500,20,TRUE );
			 MoveWindow (hwndButton,250,10,300,90, TRUE);
             return 0;

		case WM_PAINT:
             hdc = BeginPaint (hwnd, &amp;ps);
             GetClientRect (hwnd, &amp;rect);
			 EndPaint(hwnd,&amp;ps) ;
			 return 0;

		case WM_COMMAND:
			switch(HIWORD(wParam))
			{
			case BN_CLICKED:				//Wenn auf Steuerelement geklickt wird 

				GetWindowText(hwndWortArt,VOK.WortArt,40) ;
				GetWindowText(hwndLAT,VOK.Lat,25);
				GetWindowText(hwndGER,VOK.Ger,100);
				GetWindowText(hwndInfo,VOK.Info,1000);
				MessageBox(hwnd,VOK.WortArt,NULL,NULL);
/*
				VOK.lpWortArt = VOK.WortArt ;
				VOK.lpLat = VOK.Lat ;
				VOK.lpGer = VOK.Ger ;
				VOK.lpInfo = VOK.Info;
*/
				if( wcscmp(VOK.lpWortArt,TEXT(&quot;nomen&quot;))==0 || wcscmp(VOK.lpWortArt,TEXT(&quot;Nomen&quot;))==0 || wcscmp(VOK.lpWortArt,TEXT(&quot;NOMEN&quot;))==0 )
				{
						VOK.Genus[0] = VOK.Info[0] ;
						MessageBox(hwnd,LPTSTR(VOK.Genus),NULL,NULL);

						VOK.Deklination[0] = VOK.Info[2] ;
						VOK.Deklination[1] = VOK.Info[3] ;
						MessageBox(hwnd,LPTSTR(VOK.Deklination),NULL,NULL);

						for( i=5 ; i&lt;1000 ; i++ )
						{
							if( VOK.Info[i] == 0x0020  )
							{
								break;
							}
							else
							{
								VOK.Stamm[i-5] = VOK.Info[i] ;
							}
						}
						MessageBox(hwnd,LPTSTR(VOK.Stamm),NULL,NULL);
				}

				if( wcscmp(VOK.lpWortArt,TEXT(&quot;adjektiv&quot;))==0 || wcscmp(VOK.lpWortArt,TEXT(&quot;Adjektiv&quot;))==0 || wcscmp(VOK.lpWortArt,TEXT(&quot;ADJEKTIV&quot;))==0 )
				{
						VOK.Deklination[0] = VOK.Info[0] ;
						VOK.Deklination[1] = VOK.Info[1] ;
						MessageBox(hwnd,LPTSTR(VOK.Deklination),NULL,NULL);

						for( i=3 ; i&lt;1000 ; i++ )
						{
							if( VOK.Info[i] == 0x0020  )
							{
								break;
							}
							else
							{
								VOK.Stamm[i-3] = VOK.Info[i] ;
							}
						}
						MessageBox(hwnd,VOK.lpStamm,NULL,NULL);
				}
				Reset() ;
				SetFocus(hwnd);

			}
			return 0;

			case WM_KEYDOWN:
				switch(wParam)
				{
				case VK_F1:
					MessageBox(hwnd,VOK.lpStamm,NULL,NULL);
				}
				return 0;

		case WM_DESTROY:
            PostQuitMessage (0);       /* send a WM_QUIT to the message queue */
            return 0;
    }

    return DefWindowProc (hwnd, message, wParam, lParam);
}
</code></pre>
<p>nach dem Vergleich ob nomen oder adjektiv stimmt in beiden was nicht [Denkfehler]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1278260</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278260</guid><dc:creator><![CDATA[noha_39]]></dc:creator><pubDate>Thu, 03 May 2007 17:09:47 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowText funktioniert beim 2. Knopfdruck nicht ! ??? on Thu, 03 May 2007 18:14:49 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;tchar.h&gt;

struct Vokabulary
{
	TCHAR	szKindOf[128];
	TCHAR	szLatin[128];
    TCHAR	szGerman[128];
    TCHAR	szInformation[1024];
    TCHAR	szGender[2];
    TCHAR	szDeclension[2];
    TCHAR	szRoot[32];

	Vokabulary() 
	{
		memset(szKindOf, 0, sizeof(TCHAR) * 128);
		memset(szLatin, 0, sizeof(TCHAR) * 128);
		memset(szGerman, 0, sizeof(TCHAR) * 128);
		memset(szInformation, 0, sizeof(TCHAR) * 1024);
		memset(szGender, 0, sizeof(TCHAR) * 1);
		memset(szDeclension, 0, sizeof(TCHAR) * 2);
		memset(szRoot, 0, sizeof(TCHAR) * 32);
	}
};

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

#define IDC_EDT_LATIN	120
#define IDC_EDT_GERMAN	121
#define IDC_EDT_KIND	122
#define IDC_EDT_INFO	123
#define IDC_BTN_NEXT	124

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR szCmdLine, int iCmdShow)
{
	WNDCLASSEX wc; 
	wc.cbSize			= sizeof (WNDCLASSEX);
	wc.cbClsExtra		= 0;
	wc.cbWndExtra		= 0;
    wc.hInstance		= hInstance;
    wc.lpszClassName	= _T(&quot;VokabularyWnd&quot;);
    wc.lpfnWndProc		= WndProc;
    wc.style			= CS_HREDRAW | CS_VREDRAW;
    wc.hIcon			= LoadIcon(NULL, IDI_APPLICATION);
	wc.hIconSm			= wc.hIcon;
    wc.hCursor			= LoadCursor (NULL, IDC_ARROW);
    wc.lpszMenuName		= NULL;                
    wc.hbrBackground	= (HBRUSH)GetStockObject(WHITE_BRUSH);

    if (RegisterClassEx(&amp;wc) == 0)
	{
		MessageBox (NULL, _T(&quot;Fehler beim registrieren der Fensterklasse!&quot;), _T(&quot;Vokabler 0.1 Beta&quot;), MB_OK | MB_ICONERROR);
		return 0;
	}

	HWND hWnd = CreateWindowEx(0, _T(&quot;VokabularyWnd&quot;), _T(&quot;Vokabler 0.1 Beta&quot;), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 900, 200, NULL, NULL, hInstance, NULL);

	if (hWnd == NULL)
	{
		MessageBox(NULL, _T(&quot;Fenster konnte nicht erstellt werden!&quot;), _T(&quot;Vokabler 0.1 Beta&quot;), MB_OK | MB_ICONERROR);
		return 0;
	}

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

	MSG msg;
	while (GetMessage (&amp;msg, NULL, 0, 0))
	{
		TranslateMessage(&amp;msg);
		DispatchMessage(&amp;msg);
	}
	return static_cast&lt;int&gt;(msg.wParam);
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message)
	{
	case WM_CREATE:
		{
			HINSTANCE hInstance = ((LPCREATESTRUCT)lParam)-&gt;hInstance;
			CreateWindowEx(0, _T(&quot;edit&quot;), NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL, 100, 13, 200, 100, hWnd, (HMENU)IDC_EDT_LATIN, hInstance, NULL);
			CreateWindowEx(0, _T(&quot;edit&quot;), NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL, 45, 45, 100, 40, hWnd, (HMENU)IDC_EDT_GERMAN, hInstance, NULL);
			CreateWindowEx(0, _T(&quot;edit&quot;), NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL, 45, 100, 300, 20, hWnd, (HMENU)IDC_EDT_KIND, hInstance, NULL);
			CreateWindowEx(0, _T(&quot;edit&quot;), NULL, WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT | ES_AUTOVSCROLL, 45, 100, 300, 20, hWnd, (HMENU)IDC_EDT_INFO, hInstance, NULL);
			CreateWindowEx(0, _T(&quot;button&quot;), _T(&quot;N E X T  -&gt;&quot;), WS_CHILD | WS_VISIBLE, 45, 45, 100, 40, hWnd, (HMENU)IDC_BTN_NEXT, hInstance, NULL);
		} break;
        case WM_SIZE:
		{
			MoveWindow(GetDlgItem(hWnd, IDC_EDT_LATIN), 45, 10, 200, 20, TRUE);
			MoveWindow(GetDlgItem(hWnd, IDC_EDT_GERMAN), 45, 45, 200, 20, TRUE);
			MoveWindow(GetDlgItem(hWnd, IDC_EDT_KIND), 45, 80, 200, 20, TRUE);
			MoveWindow(GetDlgItem(hWnd, IDC_EDT_INFO), 45, 115, 500, 20, TRUE);
			MoveWindow(GetDlgItem(hWnd, IDC_BTN_NEXT), 250, 10, 300, 90, TRUE);
		} break;    
		case WM_PAINT:
		{
			PAINTSTRUCT ps;
			HDC hDC = BeginPaint(hWnd, &amp;ps);
			EndPaint(hWnd, &amp;ps);
		} break;
		case WM_COMMAND:
		{
			switch (HIWORD(wParam))
			{
            case BN_CLICKED:
				{
					Vokabulary vok;
					GetWindowText(GetDlgItem(hWnd, IDC_EDT_KIND), vok.szKindOf, 128);
					GetWindowText(GetDlgItem(hWnd, IDC_EDT_LATIN), vok.szLatin, 128);
					GetWindowText(GetDlgItem(hWnd, IDC_EDT_GERMAN), vok.szGerman, 128);
					GetWindowText(GetDlgItem(hWnd, IDC_EDT_INFO), vok.szInformation, 1024);

					if (lstrcmp(vok.szKindOf, _T(&quot;nomen&quot;)) == 0 || 
						lstrcmp(vok.szKindOf, _T(&quot;Nomen&quot;)) == 0 || 
						lstrcmp(vok.szKindOf, _T(&quot;NOMEN&quot;)) == 0)
					{
						vok.szGender[0] = vok.szInformation[0];
						vok.szGender[1] = '\0'; /* 0 */
						MessageBox(hWnd, vok.szGender, _T(&quot;Vokabler 0.1 Beta&quot;), MB_OK | MB_ICONINFORMATION);

						vok.szDeclension[0] = vok.szInformation[2];
						vok.szDeclension[1] = vok.szInformation[3];
						vok.szDeclension[2] = '\0';
						MessageBox(hWnd, vok.szDeclension,_T(&quot;Vokabler 0.1 Beta&quot;), MB_OK | MB_ICONINFORMATION);
					}
				} break;
			}
		} break;
		case WM_DESTROY:
		{
			PostQuitMessage(0);
		} break;
		default: 
			return DefWindowProc(hWnd, message, wParam, lParam);
    }
    return 0;
}
</code></pre>
<p>Und da musst du mal gucken ... hab jetzt mal C (bis auf der Konstruktor der Struct) genommen. An sonnsten würde ich da mit anderen Sachen rangehen. Würde mir bsw. dann eine Funktion get_text schreiben die dir den Text(dynamische Länge) aus dem Control in nen std::basic_string&lt;TCHAR&gt; ließt, schreiben. Usw ... also da kann man einiges verschönern ... und das mit den zuweisen von bsw. vok.szGender[0] = vok.szInformation[0]; ist auch nicht das wahre ... würde ich auch anders machen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1278302</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278302</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Thu, 03 May 2007 18:14:49 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowText funktioniert beim 2. Knopfdruck nicht ! ??? on Thu, 03 May 2007 18:43:58 GMT]]></title><description><![CDATA[<p>noha_39 schrieb:</p>
<blockquote>
<pre><code class="language-cpp">for( i=3 ; i&lt;1000 ; i++ )
	{
		if( VOK.Info[i] == 0x0020  )
		{
			break;
		}
		else
		{
			VOK.Stamm[i-3] = VOK.Info[i] ;
		}
</code></pre>
</blockquote>
<p>Diese Kopierschleifen sind ein Problem. VOK.Stamm läuft über, wenn in <a href="http://WOK.Info" rel="nofollow">WOK.Info</a> nicht spätestens an 23. Stelle ein Leerzeichen steht. Ist überhaupt kein Leerzeichen drin, schreibst du fast 1000 Zeichen in ein 20-Zeichen-Array.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1278323</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278323</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Thu, 03 May 2007 18:43:58 GMT</pubDate></item><item><title><![CDATA[Reply to GetWindowText funktioniert beim 2. Knopfdruck nicht ! ??? on Thu, 03 May 2007 18:51:00 GMT]]></title><description><![CDATA[<p>Vielen Dank für die Verschönerung+ Optimierungen und für den Hinweis auf das Problem mit der Schleife ( bin halt noch Anfänger und da übersieht man schnell was) Ich werd noch was rumexperimentieren aber es wird hoffentlich klappen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1278330</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1278330</guid><dc:creator><![CDATA[noha_39]]></dc:creator><pubDate>Thu, 03 May 2007 18:51:00 GMT</pubDate></item></channel></rss>