<?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_CREATE und GetRectClient]]></title><description><![CDATA[<p>hallo zusammen,</p>
<p>ich möchte bei der bearbeitung von WM_CREATE eine Bitmap erzeugen, deren größe ich über GetClientRect bestimmen will. der kot sieht ungefähr so aus:</p>
<pre><code class="language-cpp">case WM_CREATE:

		GetClientRect (hwnd, &amp;rect);

		cxBitmap = rect.right-200; cyBitmap =rect.bottom-200;
		hdc = GetDC (hwnd);
		hdcMem = CreateCompatibleDC (hdc);
		hBitmap = CreateCompatibleBitmap (hdc, cxBitmap, cyBitmap);
		ReleaseDC (hwnd, hdc);

		SelectObject (hdcMem, hBitmap);
</code></pre>
<p>problem ist nur, dass zum zeitpunkt von WM_CREATE die größe des anwendungsbereich anscheinend noch nicht feststeht, ich bekomme mit GetClientRect zumindest keine vernünftigen werte. habt ihr vielleicht eine alternative?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/148605/wm_create-und-getrectclient</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 10:35:17 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/148605.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 28 May 2006 16:01:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to WM_CREATE und GetRectClient on Sun, 28 May 2006 16:01:27 GMT]]></title><description><![CDATA[<p>hallo zusammen,</p>
<p>ich möchte bei der bearbeitung von WM_CREATE eine Bitmap erzeugen, deren größe ich über GetClientRect bestimmen will. der kot sieht ungefähr so aus:</p>
<pre><code class="language-cpp">case WM_CREATE:

		GetClientRect (hwnd, &amp;rect);

		cxBitmap = rect.right-200; cyBitmap =rect.bottom-200;
		hdc = GetDC (hwnd);
		hdcMem = CreateCompatibleDC (hdc);
		hBitmap = CreateCompatibleBitmap (hdc, cxBitmap, cyBitmap);
		ReleaseDC (hwnd, hdc);

		SelectObject (hdcMem, hBitmap);
</code></pre>
<p>problem ist nur, dass zum zeitpunkt von WM_CREATE die größe des anwendungsbereich anscheinend noch nicht feststeht, ich bekomme mit GetClientRect zumindest keine vernünftigen werte. habt ihr vielleicht eine alternative?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1066775</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1066775</guid><dc:creator><![CDATA[Machiavelli]]></dc:creator><pubDate>Sun, 28 May 2006 16:01:27 GMT</pubDate></item><item><title><![CDATA[Reply to WM_CREATE und GetRectClient on Sun, 28 May 2006 16:05:25 GMT]]></title><description><![CDATA[<p>ach ja, so wird das fenster bei mir erzeugt, falls das noch weiterhilft</p>
<pre><code class="language-cpp">hwndPaint = CreateWindow (szPaintClass2Name, TEXT (&quot;Rechteckhohlleiter&quot;),
											WS_OVERLAPPEDWINDOW | WS_CHILD | WS_CLIPSIBLINGS, 
											CW_USEDEFAULT, CW_USEDEFAULT,
											CW_USEDEFAULT, CW_USEDEFAULT,
											GetParent (hDlg), NULL, hInst, 
											&amp;data);

				ShowWindow (hwndPaint, SW_MAXIMIZE);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1066776</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1066776</guid><dc:creator><![CDATA[Machiavelli]]></dc:creator><pubDate>Sun, 28 May 2006 16:05:25 GMT</pubDate></item><item><title><![CDATA[Reply to WM_CREATE und GetRectClient on Sun, 28 May 2006 17:06:16 GMT]]></title><description><![CDATA[<p>Die Größe wird erst nach WM_CREATE mit der Nachricht engültig WM_SIZE festgelegt.<br />
Allerdings wird im LPARAM der WM_CREATE Nachricht die gewünschten Größenparameter übergeben in der CREATESTRUCT.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1066823</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1066823</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sun, 28 May 2006 17:06:16 GMT</pubDate></item><item><title><![CDATA[Reply to WM_CREATE und GetRectClient on Sun, 28 May 2006 17:10:59 GMT]]></title><description><![CDATA[<p>--sorry falscher thread--</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1066828</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1066828</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sun, 28 May 2006 17:10:59 GMT</pubDate></item><item><title><![CDATA[Reply to WM_CREATE und GetRectClient on Sun, 28 May 2006 22:33:00 GMT]]></title><description><![CDATA[<p>ja nö, ist doch der richtige tread. ich habs auch schon mal über CREATESTRUCT probiert, also dem fenste über CreateWindoe ne feste größe gegeben und dann versucht über lParam die größe auszulesen. das hat aber irgendwie net gefunzt. gibts denn nach WM_CREATE auch direkt ne WM_SIZE message? soweit ich weiß folgt darauf ja auch die WM_PAINT message, oder bin ich da jetzt falsch informiert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1067035</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1067035</guid><dc:creator><![CDATA[Machiavelli]]></dc:creator><pubDate>Sun, 28 May 2006 22:33:00 GMT</pubDate></item><item><title><![CDATA[Reply to WM_CREATE und GetRectClient on Mon, 29 May 2006 06:08:00 GMT]]></title><description><![CDATA[<p>Der falsche thread entstand dadurch, dass ich eine Antwort für einen anderen Thread´in diesen geschrieben habe.</p>
<p>Und ja. WM_SIZE kommt kurze Zeit später.<br />
Wie hast Du denn auf den lParam für die CREATESTRUCT zugegriffen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1067070</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1067070</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 29 May 2006 06:08:00 GMT</pubDate></item><item><title><![CDATA[Reply to WM_CREATE und GetRectClient on Mon, 29 May 2006 06:46:50 GMT]]></title><description><![CDATA[<p>also das sah dann ungefähr so aus:</p>
<pre><code class="language-cpp">hwndPaint = CreateWindow (szPaintClassName, TEXT (&quot;Rechteckhohlleiter&quot;),
											WS_OVERLAPPEDWINDOW | WS_CHILD | WS_CLIPSIBLINGS, 
											500, 500,	
										    CW_USEDEFAULT, CW_USEDEFAULT,
											GetParent (hDlg), NULL, hInst, 
											&amp;data);
</code></pre>
<p>und dann bei WM_CREATE</p>
<pre><code class="language-cpp">cxBitmap = (int) ((LPCREATESTRUCT)lParam)-&gt;cx;
</code></pre>
<p>und als ich mir das gerade nochmal angeguckt habe, ist mir dann auch aufgefallen, dass ich bei CreateWindow nicht die fenstergröße sondern die position festgelegt habe. fehler behoben und es läuft, sogar mit GetClientRect.<br />
Danke für die Hilfe <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/1067091</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1067091</guid><dc:creator><![CDATA[Machiavelli]]></dc:creator><pubDate>Mon, 29 May 2006 06:46:50 GMT</pubDate></item></channel></rss>