<?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[WinAPI testen]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich kann C++ Grundlagen und Ausgaben halt im DosFenster. Objektorientiert kann ich auch Klassen usw. Programmieren. Und jetzt wollte ich ein Fenster programmieren. Mir wurden links und tutorial gegeben. Aber mein Problem ist gerade, dass ich bis jetzt mit Visual C++ 6.0 programmiert habe und mich in WinAPI überhaupt nicht auskenne. Kann mir jemand da mal weiterhelfe, wie ich überhaupt ein Projekt erstellen soll.</p>
<p>Wie kann ich dieses Code ausführen?</p>
<pre><code class="language-cpp">//-----------------------------------------------------------------------------
// Defines

#define WIN32_LEAN_AND_MEAN // MFC wird nicht benoetigt

//-----------------------------------------------------------------------------
// Header

#include &lt;windows.h&gt;
#include &lt;TCHAR.h&gt;

//-----------------------------------------------------------------------------
// Event Handler
LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
	switch(msg)
	{
		case WM_DESTROY:
			PostQuitMessage(0);
			return 0;

		default: break;
	}

	return (DefWindowProc(hwnd, msg, wparam, lparam));
}

//-----------------------------------------------------------------------------
// Main
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdline, int nCmdShow)
{
	WNDCLASSEX winclass;
	winclass.cbSize = sizeof(WNDCLASSEX);
	winclass.style = CS_VREDRAW | CS_HREDRAW | CS_OWNDC | CS_DBLCLKS;
	winclass.lpfnWndProc = WindowProc;
	winclass.cbClsExtra = 0; // extra class info space
	winclass.cbWndExtra = 0; // extra window info space
	winclass.hInstance = hInstance; // assign the application instance
	winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
	winclass.hCursor = LoadCursor(NULL, IDC_ARROW);
	winclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
	winclass.lpszMenuName = NULL; // the name of the menu to attach
	winclass.lpszClassName = __T(&quot;WINCLASS1&quot;); // the name of the class itself
	winclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);

	RegisterClassEx(&amp;winclass);
	HWND hwnd;
	hwnd = CreateWindowEx(	NULL,
							__T(&quot;WINCLASS1&quot;),
							__T(&quot;Fenstertitel&quot;),
							WS_OVERLAPPEDWINDOW | WS_VISIBLE,
							0,
							0,
							200,
							200,
							NULL, // handle to parent
							NULL, // handle to menu
							hInstance, // instance of this application
							NULL);

	if(hwnd==NULL)
		return -10;

	//UpdateWindow();

	MSG msg;
	while(GetMessage(&amp;msg, NULL, 0, 0))
	{
		// translate any accelerator keys
		TranslateMessage(&amp;msg);
		// send the message to the window proc
		DispatchMessage(&amp;msg);
	}
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/138204/winapi-testen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 21:37:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/138204.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 24 Feb 2006 10:14:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to WinAPI testen on Fri, 24 Feb 2006 10:14:54 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich kann C++ Grundlagen und Ausgaben halt im DosFenster. Objektorientiert kann ich auch Klassen usw. Programmieren. Und jetzt wollte ich ein Fenster programmieren. Mir wurden links und tutorial gegeben. Aber mein Problem ist gerade, dass ich bis jetzt mit Visual C++ 6.0 programmiert habe und mich in WinAPI überhaupt nicht auskenne. Kann mir jemand da mal weiterhelfe, wie ich überhaupt ein Projekt erstellen soll.</p>
<p>Wie kann ich dieses Code ausführen?</p>
<pre><code class="language-cpp">//-----------------------------------------------------------------------------
// Defines

#define WIN32_LEAN_AND_MEAN // MFC wird nicht benoetigt

//-----------------------------------------------------------------------------
// Header

#include &lt;windows.h&gt;
#include &lt;TCHAR.h&gt;

//-----------------------------------------------------------------------------
// Event Handler
LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
	switch(msg)
	{
		case WM_DESTROY:
			PostQuitMessage(0);
			return 0;

		default: break;
	}

	return (DefWindowProc(hwnd, msg, wparam, lparam));
}

//-----------------------------------------------------------------------------
// Main
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdline, int nCmdShow)
{
	WNDCLASSEX winclass;
	winclass.cbSize = sizeof(WNDCLASSEX);
	winclass.style = CS_VREDRAW | CS_HREDRAW | CS_OWNDC | CS_DBLCLKS;
	winclass.lpfnWndProc = WindowProc;
	winclass.cbClsExtra = 0; // extra class info space
	winclass.cbWndExtra = 0; // extra window info space
	winclass.hInstance = hInstance; // assign the application instance
	winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
	winclass.hCursor = LoadCursor(NULL, IDC_ARROW);
	winclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
	winclass.lpszMenuName = NULL; // the name of the menu to attach
	winclass.lpszClassName = __T(&quot;WINCLASS1&quot;); // the name of the class itself
	winclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);

	RegisterClassEx(&amp;winclass);
	HWND hwnd;
	hwnd = CreateWindowEx(	NULL,
							__T(&quot;WINCLASS1&quot;),
							__T(&quot;Fenstertitel&quot;),
							WS_OVERLAPPEDWINDOW | WS_VISIBLE,
							0,
							0,
							200,
							200,
							NULL, // handle to parent
							NULL, // handle to menu
							hInstance, // instance of this application
							NULL);

	if(hwnd==NULL)
		return -10;

	//UpdateWindow();

	MSG msg;
	while(GetMessage(&amp;msg, NULL, 0, 0))
	{
		// translate any accelerator keys
		TranslateMessage(&amp;msg);
		// send the message to the window proc
		DispatchMessage(&amp;msg);
	}
	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1001747</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1001747</guid><dc:creator><![CDATA[jippii]]></dc:creator><pubDate>Fri, 24 Feb 2006 10:14:54 GMT</pubDate></item><item><title><![CDATA[Reply to WinAPI testen on Fri, 24 Feb 2006 10:57:39 GMT]]></title><description><![CDATA[<p>Compilieren, linken und dann auf die .EXE-Datei doppelt klicken. <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>Anderenfalls die Frage genauer stellen. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1001793</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1001793</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Fri, 24 Feb 2006 10:57:39 GMT</pubDate></item><item><title><![CDATA[Reply to WinAPI testen on Fri, 24 Feb 2006 11:21:30 GMT]]></title><description><![CDATA[<p>Ok es klappt schon. Ich musste beim Projektauswahl Win32 Anwendung nehmen.<br />
Aber noch eine Frage.</p>
<p>Das alles, was man mit WinAPI schreibt kann man auch bei MFC einfach zusammenbasteln. Oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1001811</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1001811</guid><dc:creator><![CDATA[jippi]]></dc:creator><pubDate>Fri, 24 Feb 2006 11:21:30 GMT</pubDate></item><item><title><![CDATA[Reply to WinAPI testen on Fri, 24 Feb 2006 11:40:41 GMT]]></title><description><![CDATA[<p>Im Prinzip würde ich sagen: ja. Allerdings habe ich das noch nicht in der Praxis erprobt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1001829</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1001829</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 24 Feb 2006 11:40:41 GMT</pubDate></item><item><title><![CDATA[Reply to WinAPI testen on Fri, 24 Feb 2006 11:44:10 GMT]]></title><description><![CDATA[<p>Im Prinzip ja, wie CStoll schon sagte. Die MFC ist eigentlich die OO-gekapselte WinAPI. Es tut also gut, zu wissen, wie die API funktioniert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1001833</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1001833</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Fri, 24 Feb 2006 11:44:10 GMT</pubDate></item><item><title><![CDATA[Reply to WinAPI testen on Fri, 24 Feb 2006 12:11:57 GMT]]></title><description><![CDATA[<p>es gibt tausende ferte GUI Framworks die Funktioniern etwa so:</p>
<pre><code class="language-cpp">Window MyWindow;
MyWindow.add(new Label(&quot;Hallo Welt&quot;));
</code></pre>
<p>kannst dir z. B. mein IMB anschauen:<br />
<a href="http://turing.fh-landshut.de/~jamann/IMB/IMB.html" rel="nofollow">http://turing.fh-landshut.de/~jamann/IMB/IMB.html</a></p>
<p>Im Regelfall schreibt man aber den GUI Code nicht selber, sondern hat dafür einen FormDesigner - da klickst du ein paar mal rum und setzt so Buttons, Textferlder und vieles mehr auf dein Window.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1001861</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1001861</guid><dc:creator><![CDATA[Vertexwahn]]></dc:creator><pubDate>Fri, 24 Feb 2006 12:11:57 GMT</pubDate></item><item><title><![CDATA[Reply to WinAPI testen on Fri, 24 Feb 2006 18:48:13 GMT]]></title><description><![CDATA[<p>Visual C++ 6.0<br />
Hmm... du solltest dir mindestens für die WinAPI mal die 2005er Version holen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> ist ja auch in der Express kostenlos... allerdings enthält diese keine Microsoft Foundation Class -.-</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1002226</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1002226</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Fri, 24 Feb 2006 18:48:13 GMT</pubDate></item></channel></rss>