<?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[Text im Editfeld verschmiert beim scrollen]]></title><description><![CDATA[<p>mein problem ist ich weiß nicht wie ich dass ändern kann,..<br />
hier der source:</p>
<pre><code class="language-cpp">#define STRICT
#include &lt;windows.h&gt;
#include &lt;windowsx.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
static LONG_PTR PrevWndProcEdit;
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK WndConsole(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK EditWndProc (HWND , UINT , WPARAM , LPARAM );
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    PSTR szCmdLine, int iCmdShow)
{
    HWND     hWnd,hConsole;
    MSG      msg;
    WNDCLASS wcmain;
    WNDCLASS wcconsole;

    const char szAppName[] = &quot;Editcontrol Tutorial&quot;;

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

    RegisterClass(&amp;wcmain);

    hWnd = CreateWindow( szAppName,
                         &quot;Editcontrol Tutorial&quot;,
                         WS_OVERLAPPEDWINDOW,
                         CW_USEDEFAULT,
                         CW_USEDEFAULT,
                         CW_USEDEFAULT,
                         CW_USEDEFAULT,
                         NULL,
                         NULL,
                         hInstance,
                         NULL );

    ShowWindow(hWnd, iCmdShow);
    UpdateWindow(hWnd);
    const char szConsoleName[] = &quot;Console&quot;;
    wcconsole.style          = CS_HREDRAW | CS_VREDRAW;
    wcconsole.lpfnWndProc    = WndConsole;
    wcconsole.cbClsExtra     = 0;
    wcconsole.cbWndExtra     = 0;
    wcconsole.hInstance      = hInstance;
    wcconsole.hIcon          = LoadIcon(NULL, IDI_APPLICATION);
    wcconsole.hCursor        = LoadCursor(NULL, IDC_ARROW);
    wcconsole.hbrBackground  = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
    wcconsole.lpszMenuName   = NULL;
    wcconsole.lpszClassName  = szConsoleName;
    RegisterClass(&amp;wcconsole);
    hConsole = CreateWindow( szConsoleName,
                         szConsoleName,
                         WS_OVERLAPPEDWINDOW,
                         CW_USEDEFAULT,
                         CW_USEDEFAULT,
                         CW_USEDEFAULT,
                         CW_USEDEFAULT,
                         NULL,
                         NULL,
                         hInstance,
                         NULL );
    ShowWindow(hConsole, iCmdShow);
    UpdateWindow(hConsole);

    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_CREATE:
 {

      return 0;
 }
 case WM_SIZE:
 {

      return 0;
 }
 case WM_CLOSE:
 {
      SendMessage(FindWindow(&quot;Console&quot;,&quot;Console&quot;),WM_CLOSE,(WPARAM)0,(LPARAM)0);
      DestroyWindow(hWnd);
      return 0;
 }
 case WM_DESTROY:
 {
      PostQuitMessage(0);
      return 0;
 }

 }
    return DefWindowProc(hWnd, message, wParam, lParam);
}

LRESULT CALLBACK WndConsole(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static HWND hEdit;

    switch(message)
    {
    case WM_CREATE:
        {            FILE *fz;
            char *buffer = NULL;
            int iFileSize;

            fz = fopen(&quot;text.txt&quot;, &quot;rb&quot;);
            if(fz != NULL)
            {
                fseek(fz, 0, SEEK_END);
                iFileSize = ftell(fz);
                buffer = (char*)malloc(iFileSize);

                fseek(fz, 0, SEEK_SET);
                fread(buffer, 1, iFileSize, fz);
                fclose(fz);
            }

              hEdit = CreateWindowEx(WS_EX_CLIENTEDGE,
                                   &quot;edit&quot;,
                                   buffer,    // &lt;- das ist der Inhalt der Editfelds
                                   WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE |
                                              ES_AUTOVSCROLL,
                                   0, 0, 0, 0,
                                   hWnd,
                                   NULL,
                                   ((LPCREATESTRUCT) lParam) -&gt; hInstance,
                                   NULL);
                 PrevWndProcEdit = SetWindowLongPtr (hEdit, GWLP_WNDPROC, 
                                (LONG_PTR) EditWndProc);       
            free(buffer);

            return 0;
        }
    case WM_SIZE:
        {MoveWindow(hEdit, 0, 0, 300, 300, TRUE);
        UpdateWindow(hEdit);
            return 0;
        }
    case WM_CLOSE:
        {FILE *fz;
            char *buffer = NULL;
            int iLength;

            iLength = GetWindowTextLength(hEdit);

            buffer = (char*)malloc(iLength);

            GetWindowText(hEdit, buffer, iLength+1);

            fz = fopen(&quot;text.txt&quot;, &quot;wb&quot;);
            fwrite(buffer, 1, iLength, fz);
            fclose(fz);

            free(buffer);

            DestroyWindow(hWnd);
            return 0;
        }
    case WM_DESTROY:
        {
            PostQuitMessage(0);
            return 0;
        }
    case WM_CTLCOLOREDIT:
         {
         SetBkMode((HDC)wParam,TRANSPARENT);         // Texthintergrund auf transparent setzen
        SetTextColor((HDC)wParam,RGB(255,255,255)); // Textfarbe auf Weiss setzen
        return (long)CreateSolidBrush(RGB(0,0,0)); 
         }
    }
    return DefWindowProc(hWnd, message, wParam, lParam);
}
LRESULT CALLBACK EditWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   switch (message)
   {
      case WM_VSCROLL:
        {UpdateWindow(hwnd);}
         break;  
   }

return CallWindowProc ((WNDPROC) PrevWndProcEdit, hwnd, message, wParam, lParam);
}
</code></pre>
<p>thx for help</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/200268/text-im-editfeld-verschmiert-beim-scrollen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 06:55:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/200268.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 12 Dec 2007 19:12:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Text im Editfeld verschmiert beim scrollen on Wed, 12 Dec 2007 19:12:06 GMT]]></title><description><![CDATA[<p>mein problem ist ich weiß nicht wie ich dass ändern kann,..<br />
hier der source:</p>
<pre><code class="language-cpp">#define STRICT
#include &lt;windows.h&gt;
#include &lt;windowsx.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
static LONG_PTR PrevWndProcEdit;
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK WndConsole(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK EditWndProc (HWND , UINT , WPARAM , LPARAM );
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    PSTR szCmdLine, int iCmdShow)
{
    HWND     hWnd,hConsole;
    MSG      msg;
    WNDCLASS wcmain;
    WNDCLASS wcconsole;

    const char szAppName[] = &quot;Editcontrol Tutorial&quot;;

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

    RegisterClass(&amp;wcmain);

    hWnd = CreateWindow( szAppName,
                         &quot;Editcontrol Tutorial&quot;,
                         WS_OVERLAPPEDWINDOW,
                         CW_USEDEFAULT,
                         CW_USEDEFAULT,
                         CW_USEDEFAULT,
                         CW_USEDEFAULT,
                         NULL,
                         NULL,
                         hInstance,
                         NULL );

    ShowWindow(hWnd, iCmdShow);
    UpdateWindow(hWnd);
    const char szConsoleName[] = &quot;Console&quot;;
    wcconsole.style          = CS_HREDRAW | CS_VREDRAW;
    wcconsole.lpfnWndProc    = WndConsole;
    wcconsole.cbClsExtra     = 0;
    wcconsole.cbWndExtra     = 0;
    wcconsole.hInstance      = hInstance;
    wcconsole.hIcon          = LoadIcon(NULL, IDI_APPLICATION);
    wcconsole.hCursor        = LoadCursor(NULL, IDC_ARROW);
    wcconsole.hbrBackground  = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
    wcconsole.lpszMenuName   = NULL;
    wcconsole.lpszClassName  = szConsoleName;
    RegisterClass(&amp;wcconsole);
    hConsole = CreateWindow( szConsoleName,
                         szConsoleName,
                         WS_OVERLAPPEDWINDOW,
                         CW_USEDEFAULT,
                         CW_USEDEFAULT,
                         CW_USEDEFAULT,
                         CW_USEDEFAULT,
                         NULL,
                         NULL,
                         hInstance,
                         NULL );
    ShowWindow(hConsole, iCmdShow);
    UpdateWindow(hConsole);

    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_CREATE:
 {

      return 0;
 }
 case WM_SIZE:
 {

      return 0;
 }
 case WM_CLOSE:
 {
      SendMessage(FindWindow(&quot;Console&quot;,&quot;Console&quot;),WM_CLOSE,(WPARAM)0,(LPARAM)0);
      DestroyWindow(hWnd);
      return 0;
 }
 case WM_DESTROY:
 {
      PostQuitMessage(0);
      return 0;
 }

 }
    return DefWindowProc(hWnd, message, wParam, lParam);
}

LRESULT CALLBACK WndConsole(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static HWND hEdit;

    switch(message)
    {
    case WM_CREATE:
        {            FILE *fz;
            char *buffer = NULL;
            int iFileSize;

            fz = fopen(&quot;text.txt&quot;, &quot;rb&quot;);
            if(fz != NULL)
            {
                fseek(fz, 0, SEEK_END);
                iFileSize = ftell(fz);
                buffer = (char*)malloc(iFileSize);

                fseek(fz, 0, SEEK_SET);
                fread(buffer, 1, iFileSize, fz);
                fclose(fz);
            }

              hEdit = CreateWindowEx(WS_EX_CLIENTEDGE,
                                   &quot;edit&quot;,
                                   buffer,    // &lt;- das ist der Inhalt der Editfelds
                                   WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE |
                                              ES_AUTOVSCROLL,
                                   0, 0, 0, 0,
                                   hWnd,
                                   NULL,
                                   ((LPCREATESTRUCT) lParam) -&gt; hInstance,
                                   NULL);
                 PrevWndProcEdit = SetWindowLongPtr (hEdit, GWLP_WNDPROC, 
                                (LONG_PTR) EditWndProc);       
            free(buffer);

            return 0;
        }
    case WM_SIZE:
        {MoveWindow(hEdit, 0, 0, 300, 300, TRUE);
        UpdateWindow(hEdit);
            return 0;
        }
    case WM_CLOSE:
        {FILE *fz;
            char *buffer = NULL;
            int iLength;

            iLength = GetWindowTextLength(hEdit);

            buffer = (char*)malloc(iLength);

            GetWindowText(hEdit, buffer, iLength+1);

            fz = fopen(&quot;text.txt&quot;, &quot;wb&quot;);
            fwrite(buffer, 1, iLength, fz);
            fclose(fz);

            free(buffer);

            DestroyWindow(hWnd);
            return 0;
        }
    case WM_DESTROY:
        {
            PostQuitMessage(0);
            return 0;
        }
    case WM_CTLCOLOREDIT:
         {
         SetBkMode((HDC)wParam,TRANSPARENT);         // Texthintergrund auf transparent setzen
        SetTextColor((HDC)wParam,RGB(255,255,255)); // Textfarbe auf Weiss setzen
        return (long)CreateSolidBrush(RGB(0,0,0)); 
         }
    }
    return DefWindowProc(hWnd, message, wParam, lParam);
}
LRESULT CALLBACK EditWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   switch (message)
   {
      case WM_VSCROLL:
        {UpdateWindow(hwnd);}
         break;  
   }

return CallWindowProc ((WNDPROC) PrevWndProcEdit, hwnd, message, wParam, lParam);
}
</code></pre>
<p>thx for help</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1419585</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1419585</guid><dc:creator><![CDATA[zeusosc]]></dc:creator><pubDate>Wed, 12 Dec 2007 19:12:06 GMT</pubDate></item><item><title><![CDATA[Reply to Text im Editfeld verschmiert beim scrollen on Wed, 12 Dec 2007 19:20:06 GMT]]></title><description><![CDATA[<p>ok,.. anstatt den hintergrund vom edit feld auf transparent zu stellen, sollte man direkt die bkColor auf schwarz setzen, dann passiert dass nicht,..<br />
gruuß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1419593</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1419593</guid><dc:creator><![CDATA[zeusosc]]></dc:creator><pubDate>Wed, 12 Dec 2007 19:20:06 GMT</pubDate></item><item><title><![CDATA[Reply to Text im Editfeld verschmiert beim scrollen on Sat, 29 Dec 2007 09:47:26 GMT]]></title><description><![CDATA[<p>gibt es auch eine andere möglichkeit, das problem zu lösen??<br />
bei mir soll der hintergrund des editfelds nicht einfarbig werden:</p>
<pre><code class="language-cpp">case WM_CTLCOLORSTATIC:
   SetBkMode ((HDC) wParam, TRANSPARENT);
   return (LONG) CreatePatternBrush(bitmap1);
</code></pre>
<p>funktioniert alles, bis auf das verschmieren der schrift</p>
<p>mfg ghill</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1427517</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1427517</guid><dc:creator><![CDATA[Ghill]]></dc:creator><pubDate>Sat, 29 Dec 2007 09:47:26 GMT</pubDate></item><item><title><![CDATA[Reply to Text im Editfeld verschmiert beim scrollen on Mon, 31 Dec 2007 10:39:46 GMT]]></title><description><![CDATA[<p>hi,<br />
ich hab das problem jetzt erstmal so gelöst:</p>
<pre><code class="language-cpp">LRESULT CALLBACK EditWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   switch (message)
   {
      case WM_VSCROLL:
		ShowWindow (hwnd, SW_HIDE) ;
		ShowWindow (hwnd, SW_SHOW) ;
         break;
   }

return CallWindowProc ((WNDPROC) PrevWndProcEdit, hwnd, message, wParam, lParam);
}
</code></pre>
<p>der text verschmiert jetzt nicht mehr, allerdings flackert das fenster beim scrollen....<br />
wäre über eine andere idee sehr dankbar.<br />
mfg ghill</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1428450</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1428450</guid><dc:creator><![CDATA[Ghill]]></dc:creator><pubDate>Mon, 31 Dec 2007 10:39:46 GMT</pubDate></item></channel></rss>