<?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[Screenshot , schon wieder ein Problem :-]]></title><description><![CDATA[<p>Was ist daran so verkehrt ??</p>
<pre><code class="language-cpp">int main()
{
	HBITMAP bmpScreen;
	HWND hwndScreen;
	HDC hdcScreen;
	void *pixel;
	HDC hdcCompatibleScreen;
	BITMAPINFO bmpinfo;
	BITMAPFILEHEADER bmpfh;
	BITMAPINFOHEADER bmpih;
	HGDIOBJ OldObj;
    DWORD bytes_written; 

	HANDLE file;

	hwndScreen = GetDesktopWindow();
	hdcScreen = GetDC(hwndScreen);

	hdcCompatibleScreen = CreateCompatibleDC(hdcScreen);

	bmpih.biSize = sizeof(BITMAPINFOHEADER);
	bmpih.biHeight = 768;
	bmpih.biWidth  = 1024;
	bmpih.biPlanes = 1;
	bmpih.biBitCount = 24;
	bmpih.biCompression = BI_RGB;
	bmpih.biSizeImage = (bmpih.biWidth * bmpih.biBitCount)*bmpih.biHeight;
	bmpih.biXPelsPerMeter = 0; 
    bmpih.biYPelsPerMeter = 0; 
    bmpih.biClrImportant = 0; 

	bmpinfo.bmiHeader  = bmpih;

	bmpScreen = CreateDIBSection(hdcScreen,&amp;bmpinfo,DIB_RGB_COLORS,(void**)pixel,NULL,NULL);

	OldObj = SelectObject(hdcCompatibleScreen,bmpScreen);
	BitBlt(hdcCompatibleScreen,0,0,1024,768,hdcScreen,0,0,SRCCOPY);

	bmpfh.bfOffBits = sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER); 
	bmpfh.bfSize = (3*bmpih.biHeight*bmpih.biWidth)+sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER); 
    bmpfh.bfType=0x4d42; 
    bmpfh.bfReserved1 = 0; 
    bmpfh.bfReserved2 = 0; 

	file=CreateFile(L&quot;c:\\mybmp.bmp&quot;,GENERIC_READ | GENERIC_WRITE,(DWORD)0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);

	WriteFile(file,&amp;bmpfh,sizeof(BITMAPFILEHEADER),&amp;bytes_written,NULL);
	WriteFile(file,&amp;bmpih,sizeof(BITMAPINFOHEADER),&amp;bytes_written,NULL);
	WriteFile(file,&amp;pixel,bmpih.biSizeImage,&amp;bytes_written,NULL);

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/143135/screenshot-schon-wieder-ein-problem</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Jul 2026 00:30:42 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/143135.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 05 Apr 2006 17:11:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Screenshot , schon wieder ein Problem :- on Wed, 05 Apr 2006 17:11:09 GMT]]></title><description><![CDATA[<p>Was ist daran so verkehrt ??</p>
<pre><code class="language-cpp">int main()
{
	HBITMAP bmpScreen;
	HWND hwndScreen;
	HDC hdcScreen;
	void *pixel;
	HDC hdcCompatibleScreen;
	BITMAPINFO bmpinfo;
	BITMAPFILEHEADER bmpfh;
	BITMAPINFOHEADER bmpih;
	HGDIOBJ OldObj;
    DWORD bytes_written; 

	HANDLE file;

	hwndScreen = GetDesktopWindow();
	hdcScreen = GetDC(hwndScreen);

	hdcCompatibleScreen = CreateCompatibleDC(hdcScreen);

	bmpih.biSize = sizeof(BITMAPINFOHEADER);
	bmpih.biHeight = 768;
	bmpih.biWidth  = 1024;
	bmpih.biPlanes = 1;
	bmpih.biBitCount = 24;
	bmpih.biCompression = BI_RGB;
	bmpih.biSizeImage = (bmpih.biWidth * bmpih.biBitCount)*bmpih.biHeight;
	bmpih.biXPelsPerMeter = 0; 
    bmpih.biYPelsPerMeter = 0; 
    bmpih.biClrImportant = 0; 

	bmpinfo.bmiHeader  = bmpih;

	bmpScreen = CreateDIBSection(hdcScreen,&amp;bmpinfo,DIB_RGB_COLORS,(void**)pixel,NULL,NULL);

	OldObj = SelectObject(hdcCompatibleScreen,bmpScreen);
	BitBlt(hdcCompatibleScreen,0,0,1024,768,hdcScreen,0,0,SRCCOPY);

	bmpfh.bfOffBits = sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER); 
	bmpfh.bfSize = (3*bmpih.biHeight*bmpih.biWidth)+sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER); 
    bmpfh.bfType=0x4d42; 
    bmpfh.bfReserved1 = 0; 
    bmpfh.bfReserved2 = 0; 

	file=CreateFile(L&quot;c:\\mybmp.bmp&quot;,GENERIC_READ | GENERIC_WRITE,(DWORD)0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);

	WriteFile(file,&amp;bmpfh,sizeof(BITMAPFILEHEADER),&amp;bytes_written,NULL);
	WriteFile(file,&amp;bmpih,sizeof(BITMAPINFOHEADER),&amp;bytes_written,NULL);
	WriteFile(file,&amp;pixel,bmpih.biSizeImage,&amp;bytes_written,NULL);

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1031301</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1031301</guid><dc:creator><![CDATA[BlackZero]]></dc:creator><pubDate>Wed, 05 Apr 2006 17:11:09 GMT</pubDate></item><item><title><![CDATA[Reply to Screenshot , schon wieder ein Problem :- on Wed, 05 Apr 2006 17:30:06 GMT]]></title><description><![CDATA[<p>falsches forum</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1031309</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1031309</guid><dc:creator><![CDATA[:XXXX]]></dc:creator><pubDate>Wed, 05 Apr 2006 17:30:06 GMT</pubDate></item><item><title><![CDATA[Reply to Screenshot , schon wieder ein Problem :- on Wed, 05 Apr 2006 17:36:25 GMT]]></title><description><![CDATA[<p>Jop sorry, den Fehler hab ich auch noch nicht beschrieben. Hab ausversehen zu fürh auf senden gedrückt.</p>
<p>Ich kann es debuggen aber danach treten tonnenweise Fehler auf !!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1031315</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1031315</guid><dc:creator><![CDATA[BlackZero]]></dc:creator><pubDate>Wed, 05 Apr 2006 17:36:25 GMT</pubDate></item><item><title><![CDATA[Reply to Screenshot , schon wieder ein Problem :- on Wed, 05 Apr 2006 17:57:19 GMT]]></title><description><![CDATA[<p>BlackZero schrieb:</p>
<blockquote>
<p>Ich kann es debuggen aber danach treten tonnenweise Fehler auf !!!</p>
</blockquote>
<p>Das hilft uns nicht, was für fehler?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1031325</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1031325</guid><dc:creator><![CDATA[...]]></dc:creator><pubDate>Wed, 05 Apr 2006 17:57:19 GMT</pubDate></item><item><title><![CDATA[Reply to Screenshot , schon wieder ein Problem :- on Wed, 05 Apr 2006 18:11:05 GMT]]></title><description><![CDATA[<p>Ich bin nun soweit ein file wird erstellt und es ist alles schwarz, toll.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1031332</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1031332</guid><dc:creator><![CDATA[BlackZero]]></dc:creator><pubDate>Wed, 05 Apr 2006 18:11:05 GMT</pubDate></item><item><title><![CDATA[Reply to Screenshot , schon wieder ein Problem :- on Wed, 05 Apr 2006 18:12:06 GMT]]></title><description><![CDATA[<p>Heute ist nicht so mein Tage den Quellcode hab ich doch vergessen</p>
<pre><code class="language-cpp">int main()
{
	HBITMAP bmpScreen;
	HWND hwndScreen;
	HDC hdcScreen;
	HBITMAP hbmScreen;
	HDC hdcCompatibleScreen;
	BITMAPINFO bmpinfo;
	BITMAPFILEHEADER bmpfh;
	BITMAPINFOHEADER bmpih;
	HGDIOBJ OldObj;
    DWORD bytes_written; 
	int* pixels = new int[1024*768];

	HANDLE file;

	hwndScreen = GetDesktopWindow();
	hdcScreen = GetDC(hwndScreen);

	hdcCompatibleScreen = CreateCompatibleDC(hdcScreen);

    ZeroMemory(&amp;bmpih,sizeof(BITMAPINFOHEADER));
	bmpih.biSize = sizeof(BITMAPINFOHEADER);
	bmpih.biHeight = 768;
	bmpih.biWidth  = 1024;
	bmpih.biPlanes = 1;
	bmpih.biBitCount = 24;
	bmpih.biCompression = BI_RGB;
	bmpih.biSizeImage = ((((bmpih.biWidth * bmpih.biBitCount) + 31) &amp; ~31) &gt;&gt; 3) * bmpih.biHeight; 
	bmpih.biXPelsPerMeter = 0; 
    bmpih.biYPelsPerMeter = 0; 
    bmpih.biClrImportant = 0; 

	bmpinfo.bmiHeader=bmpih;

	hbmScreen = CreateCompatibleBitmap(hdcScreen,1024,768); 

	//hOLT ES VOM DESKTOP UND kOPIERT ES IN EIN rECTANGEL
	BitBlt(hdcCompatibleScreen,0,0,1024,768,hdcScreen,0,0,SRCCOPY);
	GetDIBits(hdcCompatibleScreen,hbmScreen,0,768,pixels,&amp;bmpinfo,DIB_RGB_COLORS);

	bmpfh.bfOffBits = sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER); 
	bmpfh.bfSize = (3*bmpih.biHeight*bmpih.biWidth)+sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER); 
    bmpfh.bfType=0x4d42; 
    bmpfh.bfReserved1 = 0; 
    bmpfh.bfReserved2 = 0; 

	file= CreateFile(L&quot;c:\\mybmp.bmp&quot;,GENERIC_WRITE,0,0,OPEN_ALWAYS,0,0); 

	WriteFile(file,&amp;bmpfh,sizeof(BITMAPFILEHEADER),&amp;bytes_written,NULL);
	WriteFile(file,&amp;bmpih,sizeof(BITMAPINFOHEADER),&amp;bytes_written,NULL);
	WriteFile(file,pixels,bmpih.biSizeImage,&amp;bytes_written,NULL);

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1031335</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1031335</guid><dc:creator><![CDATA[BloackZero]]></dc:creator><pubDate>Wed, 05 Apr 2006 18:12:06 GMT</pubDate></item><item><title><![CDATA[Reply to Screenshot , schon wieder ein Problem :- on Wed, 05 Apr 2006 21:02:32 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=403" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1031441</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1031441</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Wed, 05 Apr 2006 21:02:32 GMT</pubDate></item><item><title><![CDATA[Reply to Screenshot , schon wieder ein Problem :- on Wed, 05 Apr 2006 21:08:04 GMT]]></title><description><![CDATA[<p>CreateCompatibleBitmap erstellt eine DDB, GetDIBits will ne DIB.<br />
Wie du nen DC in ein file schreibst findest du hier:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39400.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-39400.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1031447</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1031447</guid><dc:creator><![CDATA[CMatt]]></dc:creator><pubDate>Wed, 05 Apr 2006 21:08:04 GMT</pubDate></item></channel></rss>