<?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[Kann mir jemand helfen?]]></title><description><![CDATA[<p>Hallo,<br />
hab gerade ein paar Tuts zum Thema WinApi durchgeackert, dann tippte ich ein Beispiel ab, und es trat ein Fehler auf....<br />
Kann mir jemand sagen was an diesem Code falsch ist?:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt; 
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);  
//Deklaration der Windows-Nachrichten-Prozedur 

int WINAPI WinMain (HINSTANCE hI, HINSTANCE hPrI, PSTR szCmdLine, int iCmdShow) 
{ 
char szName[] = &quot;Fensterklasse&quot;; 
WNDCLASS wc; 

wc.style         = CS_HREDRAW | CS_VREDRAW;   // CS = &quot;class style&quot; 
wc.lpfnWndProc   = WndProc; 
wc.cbClsExtra    = 0; 
wc.cbWndExtra    = 0; 
wc.hInstance     = hI; 
wc.hIcon         = LoadIcon (NULL, IDI_WINLOGO); 
wc.hCursor       = LoadCursor (NULL, IDC_ARROW); 
wc.hbrBackground = (HBRUSH) GetStockObject (BLACK_BRUSH); 
wc.lpszMenuName  = NULL; 
wc.lpszClassName = szName; 

RegisterClass (&amp;wc); 

HWND hwnd = CreateWindow (szName, &quot;&quot;, WS_SYSMENU | WS_THICKFRAME,  
                          0, 0, 200, 100, NULL, NULL, hI, NULL); 

ShowWindow   (hwnd, iCmdShow); 
UpdateWindow (hwnd); 

// Nachrichten-Schleife 
MSG msg; 
    while (GetMessage (&amp;msg, NULL, 0, 0)) 
    { 
        TranslateMessage (&amp;msg); 
        DispatchMessage (&amp;msg); 
    } 
return msg.wParam; 
} 

// Windows-Nachrichten-Prozedur 
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) 
{ 
HDC hdc; 
PAINTSTRUCT ps; 

switch (message) 
{ 
case WM_PAINT: 
    hdc = BeginPaint (hwnd, &amp;ps); 
        TextOut (hdc, 20, 20, &quot;Ich bin ein Fenster.&quot;, 20); 
    EndPaint (hwnd, &amp;ps); 
    return 0; 

case WM_DESTROY: 
    PostQuitMessage (0); 
    return 0; 
} 

return DefWindowProc (hwnd, message, wParam, lParam); 
}
</code></pre>
<p>P.S.: Den Code habe ich von <a href="http://www.henkessoft.de" rel="nofollow">http://www.henkessoft.de</a>!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/156770/kann-mir-jemand-helfen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 22:33:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/156770.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 19 Aug 2006 21:49:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Kann mir jemand helfen? on Sat, 19 Aug 2006 21:54:39 GMT]]></title><description><![CDATA[<p>Hallo,<br />
hab gerade ein paar Tuts zum Thema WinApi durchgeackert, dann tippte ich ein Beispiel ab, und es trat ein Fehler auf....<br />
Kann mir jemand sagen was an diesem Code falsch ist?:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt; 
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);  
//Deklaration der Windows-Nachrichten-Prozedur 

int WINAPI WinMain (HINSTANCE hI, HINSTANCE hPrI, PSTR szCmdLine, int iCmdShow) 
{ 
char szName[] = &quot;Fensterklasse&quot;; 
WNDCLASS wc; 

wc.style         = CS_HREDRAW | CS_VREDRAW;   // CS = &quot;class style&quot; 
wc.lpfnWndProc   = WndProc; 
wc.cbClsExtra    = 0; 
wc.cbWndExtra    = 0; 
wc.hInstance     = hI; 
wc.hIcon         = LoadIcon (NULL, IDI_WINLOGO); 
wc.hCursor       = LoadCursor (NULL, IDC_ARROW); 
wc.hbrBackground = (HBRUSH) GetStockObject (BLACK_BRUSH); 
wc.lpszMenuName  = NULL; 
wc.lpszClassName = szName; 

RegisterClass (&amp;wc); 

HWND hwnd = CreateWindow (szName, &quot;&quot;, WS_SYSMENU | WS_THICKFRAME,  
                          0, 0, 200, 100, NULL, NULL, hI, NULL); 

ShowWindow   (hwnd, iCmdShow); 
UpdateWindow (hwnd); 

// Nachrichten-Schleife 
MSG msg; 
    while (GetMessage (&amp;msg, NULL, 0, 0)) 
    { 
        TranslateMessage (&amp;msg); 
        DispatchMessage (&amp;msg); 
    } 
return msg.wParam; 
} 

// Windows-Nachrichten-Prozedur 
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) 
{ 
HDC hdc; 
PAINTSTRUCT ps; 

switch (message) 
{ 
case WM_PAINT: 
    hdc = BeginPaint (hwnd, &amp;ps); 
        TextOut (hdc, 20, 20, &quot;Ich bin ein Fenster.&quot;, 20); 
    EndPaint (hwnd, &amp;ps); 
    return 0; 

case WM_DESTROY: 
    PostQuitMessage (0); 
    return 0; 
} 

return DefWindowProc (hwnd, message, wParam, lParam); 
}
</code></pre>
<p>P.S.: Den Code habe ich von <a href="http://www.henkessoft.de" rel="nofollow">http://www.henkessoft.de</a>!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1120638</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1120638</guid><dc:creator><![CDATA[ZeitZumFaken]]></dc:creator><pubDate>Sat, 19 Aug 2006 21:54:39 GMT</pubDate></item><item><title><![CDATA[Reply to Kann mir jemand helfen? on Sat, 19 Aug 2006 22:26:52 GMT]]></title><description><![CDATA[<p>Wenn du uns sagst was du für eine Fehlermeldung bekommst, damit wir das nicht alles durchlesen müssen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1120655</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1120655</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sat, 19 Aug 2006 22:26:52 GMT</pubDate></item><item><title><![CDATA[Reply to Kann mir jemand helfen? on Sat, 19 Aug 2006 22:37:31 GMT]]></title><description><![CDATA[<p>(D)Evil schrieb:</p>
<blockquote>
<p>Wenn du uns sagst was du für eine Fehlermeldung bekommst, damit wir das nicht alles durchlesen müssen...</p>
</blockquote>
<p>Ich tippe mal ins Grüne. Er verwendet Visual C++ 2005 Express Edition und er bekommt Probleme weil der Unicode haben will <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>
<p>Edit: In diesem Fall verwendest du, ZeitZumFaken, am besten das TEXT() Makro für deine Strings und <em>TCHAR</em> anstatt <em>char</em> das Problem sollte gegessen sein.</p>
<p>BR<br />
Vinzenz</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1120657</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1120657</guid><dc:creator><![CDATA[evilissimo]]></dc:creator><pubDate>Sat, 19 Aug 2006 22:37:31 GMT</pubDate></item><item><title><![CDATA[Reply to Kann mir jemand helfen? on Sun, 20 Aug 2006 10:15:43 GMT]]></title><description><![CDATA[<p>Sry, wusste ich hab was vergessen^^<br />
Da die Fehlermeldung;</p>
<p>[Linker error] undefined reference to <code>GetStockObject@4' \[Linker error\] undefined reference to</code>TextOutA@20'<br />
ld returned 1 exit status</p>
<p>Nach längerenheruprobieren fiel mir auf, wenn ich diesen Teil:<br />
wc.hbrBackground = (HBRUSH) GetStockObject (BLACK_BRUSH); so ändere: wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);</p>
<p>und diesen Teil: TextOut (hdc, 20, 20, &quot;Ich bin ein Fenster.&quot;, 20);<br />
komplett weglasse funktionierts, doch wie kann ich in dem Fenster einen Text ausgeben ohne TextOut?</p>
<p>Edit:<br />
Ich vewende den Compiler Dev-C++ von Bloodshed!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1120769</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1120769</guid><dc:creator><![CDATA[ZeitZumFaken]]></dc:creator><pubDate>Sun, 20 Aug 2006 10:15:43 GMT</pubDate></item><item><title><![CDATA[Reply to Kann mir jemand helfen? on Sun, 20 Aug 2006 10:46:11 GMT]]></title><description><![CDATA[<p>ZeitZumFaken schrieb:</p>
<blockquote>
<p>[...]<br />
wie kann ich in dem Fenster einen Text ausgeben ohne TextOut?</p>
</blockquote>
<p>DrawText(Ex)</p>
<p>ZeitZumFaken schrieb:</p>
<blockquote>
<p>Ich vewende den Compiler Dev-C++ von Bloodshed!</p>
</blockquote>
<p>Ich würd dir <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-143003-and-sid-is-f673387d90670f814e44e66f1cd192ab.html" rel="nofollow">VC++ 2005 Express Edition</a> empfehlen. Da sind die Header/Libs komplett <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1120798</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1120798</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Sun, 20 Aug 2006 10:46:11 GMT</pubDate></item><item><title><![CDATA[Reply to Kann mir jemand helfen? on Sun, 20 Aug 2006 11:26:26 GMT]]></title><description><![CDATA[<p>guck mal in der MSDN da steht zu welchen Funktionen du welche Librarys brauchst...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1120814</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1120814</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sun, 20 Aug 2006 11:26:26 GMT</pubDate></item></channel></rss>