<?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[Begrenzte Editbox &#x2F; Edit Control]]></title><description><![CDATA[<p>Hallo ich will eine Editbox in ihren Grenzen für die Zeicheneingabe begrenzen (soll mal variabel durch den User eingestellt werden, z.b. 80 Zeichen x40 Zeilen, wobei 80x20 dargestellt sollen begrenzt werden können auf 20x20)<br />
Wie kann ich das anstellen ?<br />
Ich dachte daran die Zeichen mit zu zählen und dann immer ein &quot;Enter&quot; einzufügen</p>
<p>Leider bekommt meine Messageproc gar keine Tasten nicht. Wie löse ist mein Problem/ meine Probleme ???</p>
<pre><code class="language-cpp">int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPTSTR lpCmdLine,int nCmdShow)
{
	UNREFERENCED_PARAMETER(hPrevInstance);
	UNREFERENCED_PARAMETER(lpCmdLine);

	MSG msg;
	HACCEL hAccelTable;

	// Globale Zeichenfolgen initialisieren
	LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
	LoadString(hInstance, DLC_MAINMenu, szWindowClass, MAX_LOADSTRING);
	MyRegisterClass(hInstance);

	// Anwendungsinitialisierung ausführen:
	if (!InitInstance (hInstance, nCmdShow))
	{
		return FALSE;
	}

	hAccelTable = LoadAccelerators(hInstance,MAKEINTRESOURCE(DLC_MAINMenu));

	// Hauptnachrichtenschleife:
	while (GetMessage(&amp;msg, NULL, 0, 0))
	{

		if (!TranslateAccelerator(msg.hwnd, hAccelTable, &amp;msg))
		{
			TranslateMessage(&amp;msg);
			DispatchMessage(&amp;msg);
		}
	}
	return (int) msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	int wmId, wmEvent;
	PAINTSTRUCT ps;
	HDC hdc;

	switch (message)
	{
	case WM_COMMAND:
		wmId    = LOWORD(wParam);
		wmEvent = HIWORD(wParam);
		// Menüauswahl bearbeiten:
		switch (wmId)
		{
		case IDM_MAINMenuOPEN:
	        control-&gt;Command(hWnd, LOWORD(wParam), HIWORD (wParam));
			return TRUE;
			break;
		case IDM_MAINMenu\1:
		  	 DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
			 break;
		case IDM_MAINMenuEXIT:
			 DestroyWindow(hWnd);
			 break;
		default:
			return DefWindowProc(hWnd, message, wParam, lParam);
		}
		break;
	case WM_PAINT:
		hdc = BeginPaint(hWnd, &amp;ps);
		// TODO: Hier den Zeichnungscode hinzufügen.
		EndPaint(hWnd, &amp;ps);
		break;
	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	default:
		return DefWindowProc(hWnd, message, wParam, lParam);
	}
	return 0;
}

// Meldungshandler für Main-Dialog für das Haupeingabefenster
BOOL CALLBACK MainDialog (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{

    switch (message)
    {

    case WM_INITDIALOG:
        try
        {
            control = new Controller (hwnd,hInst);
			int cTabs = 1;
			int lpnTabs[1]={80};
			SendDlgItemMessage(hwnd, IDC_LIST, LB_SETTABSTOPS, (WPARAM)cTabs, (LPARAM)lpnTabs);
        }
        catch (WinException e)
        {
				MessageBox (0, e.GetMessage (),&quot;Exception&quot;, MB_ICONEXCLAMATION | MB_OK);
        }
        catch (...)
        {
			MessageBox (0,&quot;Unknown&quot;,&quot;Exception&quot;, MB_ICONEXCLAMATION | MB_OK);
            return -1;
        }
        return TRUE;
    case WM_COMMAND:
        control-&gt;Command(hwnd, LOWORD(wParam), HIWORD (wParam));
        return TRUE;
    case WM_DESTROY:
        PostQuitMessage(0);
        return TRUE;
    case WM_CLOSE:
        delete control;
        DestroyWindow (hwnd);
        return TRUE;
    }
    return FALSE;
}
</code></pre>
<p>(alt+c)</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/240867/begrenzte-editbox-edit-control</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Apr 2026 06:40:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/240867.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 12 May 2009 19:36:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Begrenzte Editbox &#x2F; Edit Control on Tue, 12 May 2009 19:36:52 GMT]]></title><description><![CDATA[<p>Hallo ich will eine Editbox in ihren Grenzen für die Zeicheneingabe begrenzen (soll mal variabel durch den User eingestellt werden, z.b. 80 Zeichen x40 Zeilen, wobei 80x20 dargestellt sollen begrenzt werden können auf 20x20)<br />
Wie kann ich das anstellen ?<br />
Ich dachte daran die Zeichen mit zu zählen und dann immer ein &quot;Enter&quot; einzufügen</p>
<p>Leider bekommt meine Messageproc gar keine Tasten nicht. Wie löse ist mein Problem/ meine Probleme ???</p>
<pre><code class="language-cpp">int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPTSTR lpCmdLine,int nCmdShow)
{
	UNREFERENCED_PARAMETER(hPrevInstance);
	UNREFERENCED_PARAMETER(lpCmdLine);

	MSG msg;
	HACCEL hAccelTable;

	// Globale Zeichenfolgen initialisieren
	LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
	LoadString(hInstance, DLC_MAINMenu, szWindowClass, MAX_LOADSTRING);
	MyRegisterClass(hInstance);

	// Anwendungsinitialisierung ausführen:
	if (!InitInstance (hInstance, nCmdShow))
	{
		return FALSE;
	}

	hAccelTable = LoadAccelerators(hInstance,MAKEINTRESOURCE(DLC_MAINMenu));

	// Hauptnachrichtenschleife:
	while (GetMessage(&amp;msg, NULL, 0, 0))
	{

		if (!TranslateAccelerator(msg.hwnd, hAccelTable, &amp;msg))
		{
			TranslateMessage(&amp;msg);
			DispatchMessage(&amp;msg);
		}
	}
	return (int) msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	int wmId, wmEvent;
	PAINTSTRUCT ps;
	HDC hdc;

	switch (message)
	{
	case WM_COMMAND:
		wmId    = LOWORD(wParam);
		wmEvent = HIWORD(wParam);
		// Menüauswahl bearbeiten:
		switch (wmId)
		{
		case IDM_MAINMenuOPEN:
	        control-&gt;Command(hWnd, LOWORD(wParam), HIWORD (wParam));
			return TRUE;
			break;
		case IDM_MAINMenu\1:
		  	 DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
			 break;
		case IDM_MAINMenuEXIT:
			 DestroyWindow(hWnd);
			 break;
		default:
			return DefWindowProc(hWnd, message, wParam, lParam);
		}
		break;
	case WM_PAINT:
		hdc = BeginPaint(hWnd, &amp;ps);
		// TODO: Hier den Zeichnungscode hinzufügen.
		EndPaint(hWnd, &amp;ps);
		break;
	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	default:
		return DefWindowProc(hWnd, message, wParam, lParam);
	}
	return 0;
}

// Meldungshandler für Main-Dialog für das Haupeingabefenster
BOOL CALLBACK MainDialog (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{

    switch (message)
    {

    case WM_INITDIALOG:
        try
        {
            control = new Controller (hwnd,hInst);
			int cTabs = 1;
			int lpnTabs[1]={80};
			SendDlgItemMessage(hwnd, IDC_LIST, LB_SETTABSTOPS, (WPARAM)cTabs, (LPARAM)lpnTabs);
        }
        catch (WinException e)
        {
				MessageBox (0, e.GetMessage (),&quot;Exception&quot;, MB_ICONEXCLAMATION | MB_OK);
        }
        catch (...)
        {
			MessageBox (0,&quot;Unknown&quot;,&quot;Exception&quot;, MB_ICONEXCLAMATION | MB_OK);
            return -1;
        }
        return TRUE;
    case WM_COMMAND:
        control-&gt;Command(hwnd, LOWORD(wParam), HIWORD (wParam));
        return TRUE;
    case WM_DESTROY:
        PostQuitMessage(0);
        return TRUE;
    case WM_CLOSE:
        delete control;
        DestroyWindow (hwnd);
        return TRUE;
    }
    return FALSE;
}
</code></pre>
<p>(alt+c)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1709596</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1709596</guid><dc:creator><![CDATA[herkules2009]]></dc:creator><pubDate>Tue, 12 May 2009 19:36:52 GMT</pubDate></item><item><title><![CDATA[Reply to Begrenzte Editbox &#x2F; Edit Control on Wed, 13 May 2009 06:11:58 GMT]]></title><description><![CDATA[<p>Wenn in einem Editfeld Zeichen eingefügt werden, erhält der Eventhandler des Dialogs die Nachricht &quot;WM_COMMAND&quot; mit &quot;HIWORD(wParam) = EN_CHANGE&quot; und &quot;LOWORD(wParam) = identifier of edit control&quot;. An dieser Stelle kannst du dann entsprechende Aktionen durdchführen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1709710</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1709710</guid><dc:creator><![CDATA[guggst du?]]></dc:creator><pubDate>Wed, 13 May 2009 06:11:58 GMT</pubDate></item><item><title><![CDATA[Reply to Begrenzte Editbox &#x2F; Edit Control on Mon, 18 May 2009 18:12:43 GMT]]></title><description><![CDATA[<p>Weiß ich dann auch welche taste gerade gedrückt wurde?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1712402</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1712402</guid><dc:creator><![CDATA[Herkules2009]]></dc:creator><pubDate>Mon, 18 May 2009 18:12:43 GMT</pubDate></item></channel></rss>