<?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[WM_PAINT]]></title><description><![CDATA[<p>hi leute....</p>
<p>hab mal wieder n kleines prob und hoffe ihr könnt mir helfen. und zwar soll ich n programm schreiben, was einfach nur n leeres fenster ist. ist ja soweit null problem. jetzt soll das fenster nach jeder änderung (minimieren, maximieren, größe verändern) die aktuelle höhe und breite anzeigen. naja, soweit bin ich jetzt:</p>
<p>[code</p>
<pre><code class="language-cpp">]#include &lt;windows.h&gt;

LRESULT CALLBACK Fensterfunktion(HWND hwnd,UINT message,
								 WPARAM wparam, LPARAM lparam) {

	int x,y,nWidth,nHeight,fwSizeType;
	char s[100];
	HDC dc;
	PAINTSTRUCT ps;

	switch(message) 
	{
		case WM_PAINT:

			dc=BeginPaint(hwnd, &amp;ps);
			if (dc != NULL)
				SetTextColor(dc,RGB(0,0,0));
				TextOut(dc,50,50, &quot;hier sollte dann höhe und breite erscheinen&quot;,50);

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

		case WM_SIZE:
			fwSizeType = wparam;      
			nWidth = LOWORD(lparam);  
			nHeight = HIWORD(lparam);
			return 0;

		case WM_DESTROY:

		PostQuitMessage(0);
		return 0;
	}	
	return DefWindowProc(hwnd, message, wparam, lparam);
}

int WINAPI WinMain(HINSTANCE dieseInstanz,HINSTANCE
				   vorigeInstanz,LPSTR t, int d) {
	MSG n;
	HWND f;

	char szAppName[]=&quot;Eine neue Fensterklasse&quot;;
	WNDCLASS wc;
	wc.style		= CS_HREDRAW | CS_VREDRAW ;
	wc.lpfnWndProc	= Fensterfunktion;
	wc.cbClsExtra	= 0;
	wc.cbWndExtra	= 0;
	wc.hInstance	= dieseInstanz;
	wc.hIcon		= LoadIcon(NULL, IDI_INFORMATION);
	wc.hCursor		= LoadCursor(NULL, IDC_CROSS);
	wc.hbrBackground= CreateSolidBrush(RGB(255,255,255));
	wc.lpszMenuName	= NULL;
	wc.lpszClassName= szAppName;

	if (!RegisterClass(&amp;wc))	{	

		return 0;
	};

	f = CreateWindow ( szAppName,
			&quot;Fenster&quot;,
			WS_OVERLAPPEDWINDOW |  WS_VISIBLE,
			100,
			100,
			800,
			600,
			NULL,
			NULL,
			dieseInstanz,
			NULL);
	while (GetMessage(&amp;n,NULL,0,0) ) {
		DispatchMessage(&amp;n);
	};
	return n.wParam;

}[/
</code></pre>
<p>code]</p>
<p>also ich glaub, das es soweit erstmal funktionieren würde, nur komm ich bei der ausgabe nicht weiter. wie gibt man variablen aus?!</p>
<p>sry - bin nich allzu lang im winapi-geschäft <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>
<p>thx für jede hilfe!!!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/145140/wm_paint</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Jul 2026 22:21:45 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/145140.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 25 Apr 2006 11:23:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to WM_PAINT on Tue, 25 Apr 2006 11:23:05 GMT]]></title><description><![CDATA[<p>hi leute....</p>
<p>hab mal wieder n kleines prob und hoffe ihr könnt mir helfen. und zwar soll ich n programm schreiben, was einfach nur n leeres fenster ist. ist ja soweit null problem. jetzt soll das fenster nach jeder änderung (minimieren, maximieren, größe verändern) die aktuelle höhe und breite anzeigen. naja, soweit bin ich jetzt:</p>
<p>[code</p>
<pre><code class="language-cpp">]#include &lt;windows.h&gt;

LRESULT CALLBACK Fensterfunktion(HWND hwnd,UINT message,
								 WPARAM wparam, LPARAM lparam) {

	int x,y,nWidth,nHeight,fwSizeType;
	char s[100];
	HDC dc;
	PAINTSTRUCT ps;

	switch(message) 
	{
		case WM_PAINT:

			dc=BeginPaint(hwnd, &amp;ps);
			if (dc != NULL)
				SetTextColor(dc,RGB(0,0,0));
				TextOut(dc,50,50, &quot;hier sollte dann höhe und breite erscheinen&quot;,50);

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

		case WM_SIZE:
			fwSizeType = wparam;      
			nWidth = LOWORD(lparam);  
			nHeight = HIWORD(lparam);
			return 0;

		case WM_DESTROY:

		PostQuitMessage(0);
		return 0;
	}	
	return DefWindowProc(hwnd, message, wparam, lparam);
}

int WINAPI WinMain(HINSTANCE dieseInstanz,HINSTANCE
				   vorigeInstanz,LPSTR t, int d) {
	MSG n;
	HWND f;

	char szAppName[]=&quot;Eine neue Fensterklasse&quot;;
	WNDCLASS wc;
	wc.style		= CS_HREDRAW | CS_VREDRAW ;
	wc.lpfnWndProc	= Fensterfunktion;
	wc.cbClsExtra	= 0;
	wc.cbWndExtra	= 0;
	wc.hInstance	= dieseInstanz;
	wc.hIcon		= LoadIcon(NULL, IDI_INFORMATION);
	wc.hCursor		= LoadCursor(NULL, IDC_CROSS);
	wc.hbrBackground= CreateSolidBrush(RGB(255,255,255));
	wc.lpszMenuName	= NULL;
	wc.lpszClassName= szAppName;

	if (!RegisterClass(&amp;wc))	{	

		return 0;
	};

	f = CreateWindow ( szAppName,
			&quot;Fenster&quot;,
			WS_OVERLAPPEDWINDOW |  WS_VISIBLE,
			100,
			100,
			800,
			600,
			NULL,
			NULL,
			dieseInstanz,
			NULL);
	while (GetMessage(&amp;n,NULL,0,0) ) {
		DispatchMessage(&amp;n);
	};
	return n.wParam;

}[/
</code></pre>
<p>code]</p>
<p>also ich glaub, das es soweit erstmal funktionieren würde, nur komm ich bei der ausgabe nicht weiter. wie gibt man variablen aus?!</p>
<p>sry - bin nich allzu lang im winapi-geschäft <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>
<p>thx für jede hilfe!!!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1044745</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1044745</guid><dc:creator><![CDATA[MW_ICEMAN]]></dc:creator><pubDate>Tue, 25 Apr 2006 11:23:05 GMT</pubDate></item><item><title><![CDATA[Reply to WM_PAINT on Tue, 25 Apr 2006 12:47:11 GMT]]></title><description><![CDATA[<p>Ist doch klar: Da wo unter TextOut() &quot;&quot;hier sollte dann höhe und breite erscheinen&quot; steht, setzt Du nWidth und nHeight ein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1044791</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1044791</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Tue, 25 Apr 2006 12:47:11 GMT</pubDate></item><item><title><![CDATA[Reply to WM_PAINT on Tue, 25 Apr 2006 16:22:24 GMT]]></title><description><![CDATA[<pre><code>if (dc != NULL) 
{
    char szText[200];
    RECT rect;
    GetClientRect(hwnd,&amp;rect);
    wsprintf(szText,&quot;Höhe %d, Breite %d&quot;, rect.bottom-rect.top, rect.right-rect.left);
    SetTextColor(dc,RGB(0,0,0)); 
    TextOut(dc,50,50, szText, lstrlen(szText)); 
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1044964</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1044964</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 25 Apr 2006 16:22:24 GMT</pubDate></item><item><title><![CDATA[Reply to WM_PAINT on Tue, 25 Apr 2006 21:08:11 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">MAKEINTRESOURCE( IDB_MEIN_TOLLES_BMP )
</code></pre>
<p>sollt's eigentlich tun.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1045271</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1045271</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Tue, 25 Apr 2006 21:08:11 GMT</pubDate></item></channel></rss>