<?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[Problem mit icons]]></title><description><![CDATA[<p>Warum funktioniert das Prog net?:</p>
<p>main</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;resource.h&quot;

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

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    PSTR szCmdLine, int iCmdShow)
{
     TCHAR    szAppName[] = TEXT (&quot;IconDemo&quot;) ;
     HWND     hwnd ;
     MSG      msg ;
     WNDCLASS wndclass ;

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

     if (!RegisterClass (&amp;wndclass))
     {    // UNICODE-Compilierung ist die einzige realistische Fehlermöglichkeit 
          MessageBox (NULL, TEXT (&quot;Programm arbeitet mit Unicode und setzt Windows NT voraus!&quot;), 
                      szAppName, MB_ICONERROR) ;
          return 0 ;
     }

     hwnd = CreateWindow (szAppName, TEXT (&quot;Icon-Demo&quot;),
                          WS_OVERLAPPEDWINDOW,
                          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 HICON hIcon ;
     static int   cxIcon, cyIcon, cxClient, cyClient ;
     HDC          hdc ;
     HINSTANCE    hInstance ;
     PAINTSTRUCT  ps ;
     int          x, y ;

     switch (message)
     {
     case WM_CREATE :
          hInstance = ((LPCREATESTRUCT) lParam)-&gt;hInstance ;
          hIcon = LoadIcon (hInstance, MAKEINTRESOURCE (IDI_ICON)) ;
          cxIcon = GetSystemMetrics (SM_CXICON) ;
          cyIcon = GetSystemMetrics (SM_CYICON) ;
          return 0 ;

     case WM_SIZE :
          cxClient = LOWORD (lParam) ;
          cyClient = HIWORD (lParam) ;
          return 0 ;

     case WM_PAINT :
          hdc = BeginPaint (hwnd, &amp;ps) ;

          for (y = 0 ; y &lt; cyClient ; y += cyIcon)
               for (x = 0 ; x &lt; cxClient ; x += cxIcon)
                    DrawIcon (hdc, x, y, hIcon) ;

               EndPaint (hwnd, &amp;ps) ;
               return 0 ;

     case WM_DESTROY :
          PostQuitMessage (0) ;
          return 0 ;
     }
     return DefWindowProc (hwnd, message, wParam, lParam) ;
}
</code></pre>
<p>ICONDEMO.RC:</p>
<pre><code class="language-cpp">#include &quot;resource.h&quot;
IDI_ICON ICON DISCARDABLE &quot;icondemo.ico&quot;
</code></pre>
<p>resource.h:</p>
<pre><code class="language-cpp">#define IDI_ICON 101
</code></pre>
<p>ICONDEMO.ICO gibts natürlich...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/85695/problem-mit-icons</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 02:36:14 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/85695.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 12 Sep 2004 08:57:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit icons on Sun, 12 Sep 2004 08:57:42 GMT]]></title><description><![CDATA[<p>Warum funktioniert das Prog net?:</p>
<p>main</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;resource.h&quot;

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

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    PSTR szCmdLine, int iCmdShow)
{
     TCHAR    szAppName[] = TEXT (&quot;IconDemo&quot;) ;
     HWND     hwnd ;
     MSG      msg ;
     WNDCLASS wndclass ;

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

     if (!RegisterClass (&amp;wndclass))
     {    // UNICODE-Compilierung ist die einzige realistische Fehlermöglichkeit 
          MessageBox (NULL, TEXT (&quot;Programm arbeitet mit Unicode und setzt Windows NT voraus!&quot;), 
                      szAppName, MB_ICONERROR) ;
          return 0 ;
     }

     hwnd = CreateWindow (szAppName, TEXT (&quot;Icon-Demo&quot;),
                          WS_OVERLAPPEDWINDOW,
                          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 HICON hIcon ;
     static int   cxIcon, cyIcon, cxClient, cyClient ;
     HDC          hdc ;
     HINSTANCE    hInstance ;
     PAINTSTRUCT  ps ;
     int          x, y ;

     switch (message)
     {
     case WM_CREATE :
          hInstance = ((LPCREATESTRUCT) lParam)-&gt;hInstance ;
          hIcon = LoadIcon (hInstance, MAKEINTRESOURCE (IDI_ICON)) ;
          cxIcon = GetSystemMetrics (SM_CXICON) ;
          cyIcon = GetSystemMetrics (SM_CYICON) ;
          return 0 ;

     case WM_SIZE :
          cxClient = LOWORD (lParam) ;
          cyClient = HIWORD (lParam) ;
          return 0 ;

     case WM_PAINT :
          hdc = BeginPaint (hwnd, &amp;ps) ;

          for (y = 0 ; y &lt; cyClient ; y += cyIcon)
               for (x = 0 ; x &lt; cxClient ; x += cxIcon)
                    DrawIcon (hdc, x, y, hIcon) ;

               EndPaint (hwnd, &amp;ps) ;
               return 0 ;

     case WM_DESTROY :
          PostQuitMessage (0) ;
          return 0 ;
     }
     return DefWindowProc (hwnd, message, wParam, lParam) ;
}
</code></pre>
<p>ICONDEMO.RC:</p>
<pre><code class="language-cpp">#include &quot;resource.h&quot;
IDI_ICON ICON DISCARDABLE &quot;icondemo.ico&quot;
</code></pre>
<p>resource.h:</p>
<pre><code class="language-cpp">#define IDI_ICON 101
</code></pre>
<p>ICONDEMO.ICO gibts natürlich...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/604972</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/604972</guid><dc:creator><![CDATA[ness]]></dc:creator><pubDate>Sun, 12 Sep 2004 08:57:42 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit icons on Sun, 12 Sep 2004 09:43:18 GMT]]></title><description><![CDATA[<p>OK, Leute, ich weiß net wieso, aber nu klappts...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/604999</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/604999</guid><dc:creator><![CDATA[ness]]></dc:creator><pubDate>Sun, 12 Sep 2004 09:43:18 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit icons on Sun, 12 Sep 2004 10:13:28 GMT]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> Dann is ja gut! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/605014</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/605014</guid><dc:creator><![CDATA[Canon]]></dc:creator><pubDate>Sun, 12 Sep 2004 10:13:28 GMT</pubDate></item></channel></rss>