<?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[Bitmap als Fensterhintergrund]]></title><description><![CDATA[<p>Hallo,<br />
Ich wollte in meiner APP anstatt einer Farbe eine Bitmap als Fensterhintergrund haben, habe dazu folgendes probiert (benutze VC++ 6.0):</p>
<pre><code class="language-cpp">HWND CreateMainWindow(HINSTANCE hInstance)
{
    WNDCLASSEX wndClass;                                   

    wndClass.cbSize        = sizeof(WNDCLASSEX);           
    wndClass.style         = CS_DBLCLKS | CS_OWNDC |
                             CS_HREDRAW | CS_VREDRAW;      
    wndClass.lpfnWndProc   = WindowFunc;                   

    wndClass.cbClsExtra    = 0;                            
    wndClass.cbWndExtra    = 0;                            
    wndClass.hInstance     = hInstance;                    

    wndClass.hbrBackground = LoadBitmap(NULL, MAKEINTRESOURCE(IDB_BACKGROUND)); // anstelle des üblichen z.B.(HBRUSH)... Hier komm ich
//nicht weiter, der Compiler gibt mir einen Fehler aus, gibt es eine andere Möglichkeit eine Bitmap als Hintergrund zu laden?
    wndClass.hCursor       = LoadCursor(NULL, IDC_ARROW);  
    wndClass.lpszMenuName  = MAKEINTRESOURCE(IDR_MENU1);   
    wndClass.lpszClassName = &quot;WindowClass&quot;;                
    wndClass.hIcon         = LoadIcon(NULL, MAKEINTRESOURCE(IDI_MEINLOGO));
    wndClass.hIconSm       = LoadIcon(NULL, MAKEINTRESOURCE(IDI_MEINLOGO));

    RegisterClassEx(&amp;wndClass);

    return CreateWindowEx(NULL,                   
                          &quot;WindowClass&quot;,          
                          &quot;H.U.N.T.I.N.G. Configuration Window&quot;,
                          WS_SYSMENU |
						  WS_MINIMIZEBOX |
                          WS_VISIBLE,
                          100, 100, 1024, 768,    
                          NULL,                   
                          NULL,                   
                          hInstance,              
                          NULL);                  
}
</code></pre>
<p>An meinem Kommentar im Quelltext könnt ihr erkennen, wo das Problem liegt, danke schonmal für eure Hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/124420/bitmap-als-fensterhintergrund</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Jul 2026 08:38:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/124420.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 27 Oct 2005 12:56:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bitmap als Fensterhintergrund on Thu, 27 Oct 2005 12:56:05 GMT]]></title><description><![CDATA[<p>Hallo,<br />
Ich wollte in meiner APP anstatt einer Farbe eine Bitmap als Fensterhintergrund haben, habe dazu folgendes probiert (benutze VC++ 6.0):</p>
<pre><code class="language-cpp">HWND CreateMainWindow(HINSTANCE hInstance)
{
    WNDCLASSEX wndClass;                                   

    wndClass.cbSize        = sizeof(WNDCLASSEX);           
    wndClass.style         = CS_DBLCLKS | CS_OWNDC |
                             CS_HREDRAW | CS_VREDRAW;      
    wndClass.lpfnWndProc   = WindowFunc;                   

    wndClass.cbClsExtra    = 0;                            
    wndClass.cbWndExtra    = 0;                            
    wndClass.hInstance     = hInstance;                    

    wndClass.hbrBackground = LoadBitmap(NULL, MAKEINTRESOURCE(IDB_BACKGROUND)); // anstelle des üblichen z.B.(HBRUSH)... Hier komm ich
//nicht weiter, der Compiler gibt mir einen Fehler aus, gibt es eine andere Möglichkeit eine Bitmap als Hintergrund zu laden?
    wndClass.hCursor       = LoadCursor(NULL, IDC_ARROW);  
    wndClass.lpszMenuName  = MAKEINTRESOURCE(IDR_MENU1);   
    wndClass.lpszClassName = &quot;WindowClass&quot;;                
    wndClass.hIcon         = LoadIcon(NULL, MAKEINTRESOURCE(IDI_MEINLOGO));
    wndClass.hIconSm       = LoadIcon(NULL, MAKEINTRESOURCE(IDI_MEINLOGO));

    RegisterClassEx(&amp;wndClass);

    return CreateWindowEx(NULL,                   
                          &quot;WindowClass&quot;,          
                          &quot;H.U.N.T.I.N.G. Configuration Window&quot;,
                          WS_SYSMENU |
						  WS_MINIMIZEBOX |
                          WS_VISIBLE,
                          100, 100, 1024, 768,    
                          NULL,                   
                          NULL,                   
                          hInstance,              
                          NULL);                  
}
</code></pre>
<p>An meinem Kommentar im Quelltext könnt ihr erkennen, wo das Problem liegt, danke schonmal für eure Hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/901929</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901929</guid><dc:creator><![CDATA[sevobal]]></dc:creator><pubDate>Thu, 27 Oct 2005 12:56:05 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap als Fensterhintergrund on Thu, 27 Oct 2005 13:32:45 GMT]]></title><description><![CDATA[<p>falsches forum <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/26a0.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--warning"
      title=":warning:"
      alt="⚠"
    /><br />
afaik geht das so nicht, sondern du musst in wm_paint das bitmap blitten.</p>
<pre><code class="language-cpp">// ungefähr so
case WM_PAINT:
    {
        BITMAP bm;
        PAINTSTRUCT ps;

        HDC hdc = BeginPaint(hwnd, &amp;ps);

        HDC hdcMem = CreateCompatibleDC(hdc);
        // hBitmapFromFile am besten static und in wm_create laden
        HBITMAP hbmOld = SelectObject(hdcMem, hBitmapFromFile);

        GetObject(hBitmapFromFile, sizeof(bm), &amp;bm);

        BitBlt(hdc, 0, 0, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY);

        SelectObject(hdcMem, hbmOld);
        DeleteDC(hdcMem);

        EndPaint(hwnd, &amp;ps);
    }
    break;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/901957</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/901957</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Thu, 27 Oct 2005 13:32:45 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap als Fensterhintergrund on Thu, 27 Oct 2005 20:13:32 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=403" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" 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/902270</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/902270</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Thu, 27 Oct 2005 20:13:32 GMT</pubDate></item><item><title><![CDATA[Reply to Bitmap als Fensterhintergrund on Sat, 29 Oct 2005 17:22:07 GMT]]></title><description><![CDATA[<p>das geht schon. du mußt jedoch die bitmap zuerst in eine brush verwandeln:</p>
<pre><code class="language-cpp">wndClass.hbrBackground = CreatePatternBrush(LoadBitmap(NULL,MAKEINTRESOURCE(IDB_BACKGROUND)));
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/903509</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/903509</guid><dc:creator><![CDATA[Konfusius]]></dc:creator><pubDate>Sat, 29 Oct 2005 17:22:07 GMT</pubDate></item></channel></rss>