<?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[BIlder in Konsole includen klappt 50 %]]></title><description><![CDATA[<p>Hey,</p>
<p>also ich habe folgenden COde gefunden der es möglich macht Bilder in ne Konsole zu packen :</p>
<pre><code>#
// put a bitmap image on a Windows Console display
#
// BCX basic original by Joe Caverly and Kevin Diggins
#
// BCX generated C code modified for PellesC/Dev-C++
#

#
#include &lt;stdio.h&gt;
#
#include &lt;string.h&gt;
#
#include &lt;windows.h&gt; // Win32Api Header File
#
#
static HWND hConWnd;
#

#
HWND BCX_Bitmap(char*,HWND=0,int=0,int=0,int=0,int=0,int=0,int=0,int=0,int=0);
#
HWND GetConsoleWndHandle(void);
#

#

#
int main()
#
{
#
hConWnd = GetConsoleWndHandle();
#
if (hConWnd)
#
{
#
// select a bitmap file you have or use one of the files in the Windows folder
#
// filename, handle, ID, ulcX, ulcY, width, height 0,0 auto-adjusts
#
BCX_Bitmap(&quot;C:\\Windows\\greenstone.bmp&quot;,hConWnd,123,1,1,0,0);
#
#
getchar(); // wait
#
}
#
return 0;
#
}
#

#

#
// draw the bitmap
#
HWND BCX_Bitmap(char* Text,HWND hWnd,int id,int X,int Y,int W,int H,int Res,int Style,int Exstyle)
#
{
#
HWND A;
#
HBITMAP hBitmap;
#
#
// set default style
#
if (!Style) Style = WS_CLIPSIBLINGS|WS_CHILD|WS_VISIBLE|SS_BITMAP|WS_TABSTOP;
#
#
// form for the image
#
A = CreateWindowEx(Exstyle,&quot;static&quot;,NULL,Style,X,Y,0,0,hWnd,(HMENU)id,GetModuleHandle(0),NULL);
#
#
// Text contains filename
#
hBitmap=(HBITMAP)LoadImage(0,Text,IMAGE_BITMAP,0,0,LR_LOADFROMFILE|LR_CREATEDIBSECTION);
#

#
// auto-adjust width and height
#
if (W || H) hBitmap = (HBITMAP)CopyImage(hBitmap,IMAGE_BITMAP,W,H,LR_COPYRETURNORG);
#
SendMessage(A,(UINT)STM_SETIMAGE,(WPARAM)IMAGE_BITMAP,(LPARAM)hBitmap);
#
if (W || H) SetWindowPos(A,HWND_TOP,X,Y,W,H,SWP_DRAWFRAME);
#
return A;
#
}
#

#

#
// tricking Windows just a little ...
#
HWND GetConsoleWndHandle(void)
#
{
#
HWND hConWnd;
#
OSVERSIONINFO os;
#
char szTempTitle[64], szClassName[128], szOriginalTitle[1024];
#

#
os.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
#
GetVersionEx( &amp;os );
#
// may not work on WIN9x
#
if ( os.dwPlatformId == VER_PLATFORM_WIN32s ) return 0;
#

#
GetConsoleTitle( szOriginalTitle, sizeof ( szOriginalTitle ) );
#
sprintf( szTempTitle,&quot;%u - %u&quot;, GetTickCount(), GetCurrentProcessId() );
#
SetConsoleTitle( szTempTitle );
#
Sleep( 40 );
#
// handle for NT and XP
#
hConWnd = FindWindow( NULL, szTempTitle );
#
SetConsoleTitle( szOriginalTitle );
#

#
// may not work on WIN9x
#
if ( os.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS )
#
{
#
hConWnd = GetWindow( hConWnd, GW_CHILD );
#
if ( hConWnd == NULL ) return 0;
#
GetClassName( hConWnd, szClassName, sizeof ( szClassName ) );
#
// while ( _stricmp( szClassName, &quot;ttyGrab&quot; ) != 0 )
#
while ( strcmp( szClassName, &quot;ttyGrab&quot; ) != 0 )
#
{
#
hConWnd = GetNextWindow( hConWnd, GW_HWNDNEXT );
#
if ( hConWnd == NULL ) return 0;
#
GetClassName( hConWnd, szClassName, sizeof( szClassName ) );
#
}
#
}
#
return hConWnd;
#
}
</code></pre>
<p>Und es klappt auch wunderbar !! nur wenn man die konsole mit dem Bild offen hat und man bewegt das fenster ein wenig hin und her oder klickt ins schwarze große feld , Hängt sich die Komplette konsole auf ..könnt ihr mir helfen..will so gerne Bilder Includen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /> ... hoffe ihr habt eine Idee bzw besseren VOrschlag</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/185896/bilder-in-konsole-includen-klappt-50</link><generator>RSS for Node</generator><lastBuildDate>Sun, 05 Jul 2026 01:36:44 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/185896.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 02 Jul 2007 15:54:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Mon, 02 Jul 2007 15:54:25 GMT]]></title><description><![CDATA[<p>Hey,</p>
<p>also ich habe folgenden COde gefunden der es möglich macht Bilder in ne Konsole zu packen :</p>
<pre><code>#
// put a bitmap image on a Windows Console display
#
// BCX basic original by Joe Caverly and Kevin Diggins
#
// BCX generated C code modified for PellesC/Dev-C++
#

#
#include &lt;stdio.h&gt;
#
#include &lt;string.h&gt;
#
#include &lt;windows.h&gt; // Win32Api Header File
#
#
static HWND hConWnd;
#

#
HWND BCX_Bitmap(char*,HWND=0,int=0,int=0,int=0,int=0,int=0,int=0,int=0,int=0);
#
HWND GetConsoleWndHandle(void);
#

#

#
int main()
#
{
#
hConWnd = GetConsoleWndHandle();
#
if (hConWnd)
#
{
#
// select a bitmap file you have or use one of the files in the Windows folder
#
// filename, handle, ID, ulcX, ulcY, width, height 0,0 auto-adjusts
#
BCX_Bitmap(&quot;C:\\Windows\\greenstone.bmp&quot;,hConWnd,123,1,1,0,0);
#
#
getchar(); // wait
#
}
#
return 0;
#
}
#

#

#
// draw the bitmap
#
HWND BCX_Bitmap(char* Text,HWND hWnd,int id,int X,int Y,int W,int H,int Res,int Style,int Exstyle)
#
{
#
HWND A;
#
HBITMAP hBitmap;
#
#
// set default style
#
if (!Style) Style = WS_CLIPSIBLINGS|WS_CHILD|WS_VISIBLE|SS_BITMAP|WS_TABSTOP;
#
#
// form for the image
#
A = CreateWindowEx(Exstyle,&quot;static&quot;,NULL,Style,X,Y,0,0,hWnd,(HMENU)id,GetModuleHandle(0),NULL);
#
#
// Text contains filename
#
hBitmap=(HBITMAP)LoadImage(0,Text,IMAGE_BITMAP,0,0,LR_LOADFROMFILE|LR_CREATEDIBSECTION);
#

#
// auto-adjust width and height
#
if (W || H) hBitmap = (HBITMAP)CopyImage(hBitmap,IMAGE_BITMAP,W,H,LR_COPYRETURNORG);
#
SendMessage(A,(UINT)STM_SETIMAGE,(WPARAM)IMAGE_BITMAP,(LPARAM)hBitmap);
#
if (W || H) SetWindowPos(A,HWND_TOP,X,Y,W,H,SWP_DRAWFRAME);
#
return A;
#
}
#

#

#
// tricking Windows just a little ...
#
HWND GetConsoleWndHandle(void)
#
{
#
HWND hConWnd;
#
OSVERSIONINFO os;
#
char szTempTitle[64], szClassName[128], szOriginalTitle[1024];
#

#
os.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
#
GetVersionEx( &amp;os );
#
// may not work on WIN9x
#
if ( os.dwPlatformId == VER_PLATFORM_WIN32s ) return 0;
#

#
GetConsoleTitle( szOriginalTitle, sizeof ( szOriginalTitle ) );
#
sprintf( szTempTitle,&quot;%u - %u&quot;, GetTickCount(), GetCurrentProcessId() );
#
SetConsoleTitle( szTempTitle );
#
Sleep( 40 );
#
// handle for NT and XP
#
hConWnd = FindWindow( NULL, szTempTitle );
#
SetConsoleTitle( szOriginalTitle );
#

#
// may not work on WIN9x
#
if ( os.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS )
#
{
#
hConWnd = GetWindow( hConWnd, GW_CHILD );
#
if ( hConWnd == NULL ) return 0;
#
GetClassName( hConWnd, szClassName, sizeof ( szClassName ) );
#
// while ( _stricmp( szClassName, &quot;ttyGrab&quot; ) != 0 )
#
while ( strcmp( szClassName, &quot;ttyGrab&quot; ) != 0 )
#
{
#
hConWnd = GetNextWindow( hConWnd, GW_HWNDNEXT );
#
if ( hConWnd == NULL ) return 0;
#
GetClassName( hConWnd, szClassName, sizeof( szClassName ) );
#
}
#
}
#
return hConWnd;
#
}
</code></pre>
<p>Und es klappt auch wunderbar !! nur wenn man die konsole mit dem Bild offen hat und man bewegt das fenster ein wenig hin und her oder klickt ins schwarze große feld , Hängt sich die Komplette konsole auf ..könnt ihr mir helfen..will so gerne Bilder Includen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /> ... hoffe ihr habt eine Idee bzw besseren VOrschlag</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1316994</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1316994</guid><dc:creator><![CDATA[Toa]]></dc:creator><pubDate>Mon, 02 Jul 2007 15:54:25 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Tue, 03 Jul 2007 12:22:15 GMT]]></title><description><![CDATA[<p>Besorg dir ne Grafikbibliothek</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1317462</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1317462</guid><dc:creator><![CDATA[oje]]></dc:creator><pubDate>Tue, 03 Jul 2007 12:22:15 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Tue, 03 Jul 2007 12:32:16 GMT]]></title><description><![CDATA[<p>Er wird wohl nicht umsonst versuchen, ein Bild in der Konsole anzuzeigen.<br />
Wozu ne lib für so ne Kleinigkeit? Reicht doch die raw WinAPI.</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1317475</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1317475</guid><dc:creator><![CDATA[ceplusplus@loggedoff]]></dc:creator><pubDate>Tue, 03 Jul 2007 12:32:16 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Tue, 03 Jul 2007 13:22:58 GMT]]></title><description><![CDATA[<p>Erstell eine Windows-Anwendung. Bilder in der Console sind *nicht* supported!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1317514</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1317514</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 03 Jul 2007 13:22:58 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Tue, 03 Jul 2007 21:27:50 GMT]]></title><description><![CDATA[<p>Mh.. also Win Andwendung ist schlecht weil ich ein Konsolen Game Progg und dann geht das alles net mehr .. und eine Grafik Lib werd ich ma schaun ob ich was finde, haste nen Tipp für mich ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1317787</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1317787</guid><dc:creator><![CDATA[Toa]]></dc:creator><pubDate>Tue, 03 Jul 2007 21:27:50 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Tue, 03 Jul 2007 23:46:30 GMT]]></title><description><![CDATA[<p>Du programmierst ein Konsolenspiel und willst Grafiken darstellen???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1317835</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1317835</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Tue, 03 Jul 2007 23:46:30 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Wed, 04 Jul 2007 08:07:22 GMT]]></title><description><![CDATA[<p>Hallo !</p>
<p>Toa schrieb:</p>
<blockquote>
<p>Mh.. also Win Andwendung ist schlecht weil ich ein Konsolen Game Progg und dann geht das alles net mehr .. und eine Grafik Lib werd ich ma schaun ob ich was finde, haste nen Tipp für mich ?</p>
</blockquote>
<p>Bibliotheken für Konsolengrafiken kenne ich nicht, aber<br />
man kann Bilder auch in der Konsole anzeigen.<br />
Guck dir doch mal das hier an:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-162280-and-highlight-is-bitmap.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-162280-and-highlight-is-bitmap.html</a></p>
<p>Gruß, p.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1317967</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1317967</guid><dc:creator><![CDATA[proggingmania]]></dc:creator><pubDate>Wed, 04 Jul 2007 08:07:22 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Wed, 04 Jul 2007 10:26:28 GMT]]></title><description><![CDATA[<p>Dies funktioniert nur, weil der DC der Comsolen Anwendung direkt manipuliert wird.</p>
<p>Warum willst Du das? Erzeuge eine Windows Applikation und Du brauchst keine Tricks dazu.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1318070</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1318070</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 04 Jul 2007 10:26:28 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Wed, 04 Jul 2007 12:05:14 GMT]]></title><description><![CDATA[<p>Martin Richter schrieb:</p>
<blockquote>
<p>Dies funktioniert nur, weil der DC der Comsolen Anwendung direkt manipuliert wird.<br />
Warum willst Du das? Erzeuge eine Windows Applikation und Du brauchst keine Tricks dazu.</p>
</blockquote>
<p>Das ist aber ein gaaaaaaaanz ein toller Trick, sich ein DC über das HWND zu holen !<br />
Booooooooooaaaaaaaah eeeeeeeeyyyyyyyyy !</p>
<p>Das ist ein so ganz ein doller Trick, wie bei der Windowsapplikation, da holt man sich auch ein DC <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="😃"
    /><br />
MfG<br />
Der Trickreiche</p>
<p>p.s.<br />
Comsolen -&gt; Consolen <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/1318169</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1318169</guid><dc:creator><![CDATA[Ein ganz toller Trick !]]></dc:creator><pubDate>Wed, 04 Jul 2007 12:05:14 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Wed, 04 Jul 2007 13:15:13 GMT]]></title><description><![CDATA[<p>es gibt ein undokumentieres flag für CreateConsoleScreenBuffer mit dem man bilder in der konsole darstellen kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1318238</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1318238</guid><dc:creator><![CDATA[btw.]]></dc:creator><pubDate>Wed, 04 Jul 2007 13:15:13 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Wed, 04 Jul 2007 13:21:53 GMT]]></title><description><![CDATA[<p>Wenn ich ne WIn Andwenung machen funktioniert dann mein Quellcode den ich für die Konsole geschrieben hab genauso ? was für ein FLag xD ? .. Kann man den Quellcode oben nicht so bearbeiten das er nicht abschmiert wenn man das fenster herumzieht oder größer macht ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1318241</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1318241</guid><dc:creator><![CDATA[Toa]]></dc:creator><pubDate>Wed, 04 Jul 2007 13:21:53 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Wed, 04 Jul 2007 13:30:21 GMT]]></title><description><![CDATA[<p>Ein ganz toller Trick ! schrieb:</p>
<blockquote>
<p>Martin Richter schrieb:</p>
<blockquote>
<p>Dies funktioniert nur, weil der DC der Comsolen Anwendung direkt manipuliert wird.<br />
Warum willst Du das? Erzeuge eine Windows Applikation und Du brauchst keine Tricks dazu.</p>
</blockquote>
<p>Das ist aber ein gaaaaaaaanz ein toller Trick, sich ein DC über das HWND zu holen !<br />
Booooooooooaaaaaaaah eeeeeeeeyyyyyyyyy !</p>
<p>Das ist ein so ganz ein doller Trick, wie bei der Windowsapplikation, da holt man sich auch ein DC <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="😃"
    /><br />
MfG<br />
Der Trickreiche</p>
<p>p.s.<br />
Comsolen -&gt; Consolen <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>
</blockquote>
<p>Es ist ein böser Hack, z.B. schonmal deswegen weil dir keiner garantiert dass die Konsole ein Fenster einer Klasse namens &quot;ttyGrab&quot; hat. Dein zynisches Kommentar ändert daran nichts.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1318251</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1318251</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Wed, 04 Jul 2007 13:30:21 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Wed, 04 Jul 2007 13:59:28 GMT]]></title><description><![CDATA[<p>Vor allem garantiert ihm keiner, dass eine consolen Anwendung überhaupt ein Fenster hat! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /></p>
<p>Und wenn kein Fenster dann scon gar keine DC!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1318280</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1318280</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 04 Jul 2007 13:59:28 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Wed, 04 Jul 2007 14:46:31 GMT]]></title><description><![CDATA[<p>Kann man mit der SDL Lib Bilder in Konsole rein bekommen ? Wie siehts aus wenn ich ne Win anwendung mache und einfach meinen Normalen Quellcode behalten kennt er ihn dann trotzdem ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1318324</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1318324</guid><dc:creator><![CDATA[Toa]]></dc:creator><pubDate>Wed, 04 Jul 2007 14:46:31 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Wed, 04 Jul 2007 16:30:19 GMT]]></title><description><![CDATA[<p>Warum muss es denn einen Konsolen Anwendung sein?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1318390</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1318390</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 04 Jul 2007 16:30:19 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Wed, 04 Jul 2007 17:00:59 GMT]]></title><description><![CDATA[<p>Toa schrieb:</p>
<blockquote>
<p>Kann man mit der SDL Lib Bilder in Konsole rein bekommen ? Wie siehts aus wenn ich ne Win anwendung mache und einfach meinen Normalen Quellcode behalten kennt er ihn dann trotzdem ?</p>
</blockquote>
<p>SDL zeigt dir Bilder nicht in der Konsole an. SDL erzeugt dir Fenster, also richtige Windows-Fenster, in denen du deine Grafiken, Bilder, etc. anzeigen lassen kannst. Davon bekommst du bloss nichts mit, weil es in Bibliothekfunktionen eingebettet ist.<br />
Das ganze kannst du von einer Konsolenanwendung aus starten, das ist richtig.</p>
<p>Was verstehst du unter deinem normalen Quellcode, meinst du das Beispiel, mit dem du den Thread eröffnet hast ?<br />
Das ist eine Mischung zwischen einem Windowsprogramm und einem Konsolenprogramm.<br />
Vom Konsolenprogramm aus ( main ) wird die CreateWindowsEx-Funktion aufgerufen, die ein Fenster erzeugt. Allerdings fehlt da noch die Fensterprozedur und die Nachrichtenschleife, unerlässlich für ein funktionierendes Windowsprogramm.<br />
Und gucke mal in Zeile 93. Das Windowshandle verschwindet im Nirvana, das nimmt keine Funktion entgegen, wird nirgends gespeichert. Das Betriebssystem weiss gar nicht, an wen es die Nachrichten schicken soll ( Mausklicks, Änderungen der Fenstergrösse, usw. )</p>
<p>Edit:</p>
<p>Und wenn du nun unbedingt ein Bild in der Konsole ausgeben möchtest, kannst du ja immernoch das Beispiel aus diesem Forum benutzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1318407</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1318407</guid><dc:creator><![CDATA[proggingmania]]></dc:creator><pubDate>Wed, 04 Jul 2007 17:00:59 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Wed, 04 Jul 2007 18:22:24 GMT]]></title><description><![CDATA[<p>Also mit normalen QUelltext meine ich einfach den QUelltext den normale Console Applications lesen. Kannst du mir zufällig den obrigen Quelltext ändern sodass die Konsole nicht mehr abschmiert <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /> hab nicht so viel Ahung von WInAnwendungen.<br />
Also wenns nicht zuviel Arbeit ist wäre es echt super brauch das unbediengt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1318462</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1318462</guid><dc:creator><![CDATA[Toa]]></dc:creator><pubDate>Wed, 04 Jul 2007 18:22:24 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Wed, 04 Jul 2007 19:47:31 GMT]]></title><description><![CDATA[<p>Ich könnte dir etwas zusammenklicken, das du von einem Konsolenprogramm aus starten kannst und das dir ein Windowsfenster mit einem Bild laden kann.</p>
<p>Aber auf Dauer wirst du damit wohl kaum glücklich werden, denn es kann dann wirklich nur ein Bild anzeigen.</p>
<p>Vielleicht lohnt es dann doch für dich, auf längere Sicht gesehen, wenn du dich mit einer Grafikbibliothek wie z.B. SDL anfreundest ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1318509</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1318509</guid><dc:creator><![CDATA[proggingmania]]></dc:creator><pubDate>Wed, 04 Jul 2007 19:47:31 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Wed, 04 Jul 2007 19:58:09 GMT]]></title><description><![CDATA[<p>ALso das hab ich sowieso vor <sup>.</sup> ... aber so als Momentan Lösung wäre das echt nett wenn du sowas schreiben könntest für mich . Das Prob ist das ich die Bilder für Folgendes brauche. Ich schreibe momentan ein Consolen Basierendes Game und der KampfModus soll so wie der von Pokemon aussehen heißt : Links oben das Monster rechts unten der CHarakter und dann kann man in einem menü unter dem Char attacken und sowas auswählen , deswegen wäre der erste Quellcode von mir auch perfect nur leider schmiert die Konsole ab wenn man sie bewegt oder größer zieht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /> *wein*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1318517</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1318517</guid><dc:creator><![CDATA[Toa]]></dc:creator><pubDate>Wed, 04 Jul 2007 19:58:09 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Wed, 04 Jul 2007 21:57:55 GMT]]></title><description><![CDATA[<p>Nu heul ma nicht gleich <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>Bitte sehr:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;stdio.h&gt;

char* pcBmp =  &quot;C:\\Pics\\abc.bmp&quot;;

int Run();
HBITMAP LoadBitmapOnce();
LRESULT CALLBACK WindProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);

int main()
{
	HWND hwnd;
	char szTitle[]   = &quot;Bitmap View starter&quot;;

	SetConsoleTitle(szTitle);
	hwnd = FindWindow( &quot;ConsoleWindowClass&quot;, szTitle);

	Run();

	PostMessage( hwnd, WM_CLOSE,0, 0);
	return 0;
}

int Run()
{
    WNDCLASSEX  WndCls;
    char szAppName[] = &quot;Bitmap View&quot;;
	MSG         Msg;

    WndCls.cbSize        = sizeof(WndCls);
    WndCls.style         = CS_OWNDC | CS_VREDRAW | CS_HREDRAW;
    WndCls.lpfnWndProc   = WindProcedure;
    WndCls.cbClsExtra    = 0;
    WndCls.cbWndExtra    = 0;
    WndCls.hInstance     = NULL;
    WndCls.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
    WndCls.hCursor       = LoadCursor(NULL, IDC_ARROW);
    WndCls.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
    WndCls.lpszMenuName  = NULL;
    WndCls.lpszClassName = szAppName;
    WndCls.hIconSm       = NULL;
    RegisterClassEx(&amp;WndCls);

    CreateWindowEx(WS_EX_OVERLAPPEDWINDOW,
                          szAppName,
                          szAppName,
                          WS_OVERLAPPEDWINDOW | WS_VISIBLE,
                          CW_USEDEFAULT,
                          CW_USEDEFAULT,
                          CW_USEDEFAULT,
                          CW_USEDEFAULT,
                          NULL,
                          NULL,
                          NULL,
                          NULL);

    while( GetMessage(&amp;Msg, NULL, 0, 0) )
    {
        TranslateMessage(&amp;Msg);
        DispatchMessage( &amp;Msg);
    }
   return  (Msg.wParam);
}

HBITMAP LoadBitmapOnce()
{
	return (HBITMAP)LoadImage(NULL, pcBmp, IMAGE_BITMAP, 0, 0,
				 LR_LOADFROMFILE | LR_CREATEDIBSECTION | LR_DEFAULTSIZE);
}

LRESULT CALLBACK WindProcedure(HWND hWnd, UINT Msg,
			   WPARAM wParam, LPARAM lParam)
{
    HDC hDC;
	HDC MemDC;
    static HBITMAP hbmp;
	static int iBitmapLoaded = 0;
	char buf[256];

	PAINTSTRUCT Ps;
	RECT r;

	if( !iBitmapLoaded )
	{
		hbmp = LoadBitmapOnce();
		if ( !hbmp )
		{
			sprintf( buf, &quot;Failed on LoadImage. %s not found.&quot;, pcBmp ); 
			MessageBox( NULL, buf, &quot;Picture not found&quot;, MB_OK );
			ExitProcess(1);
		}
		iBitmapLoaded = 1;
	}

	if ( !GetWindowRect( hWnd, &amp;r ) )
	{		 
		MessageBox( NULL, &quot;Failed on GetWindowRect&quot;, &quot;Error&quot;, MB_OK );
		ExitProcess(1);
	}

    switch(Msg)
    {
		case WM_DESTROY:

			DeleteObject(hbmp);
			PostQuitMessage(WM_QUIT);

		break;

		case WM_PAINT:

			hDC = BeginPaint(hWnd, &amp;Ps);
			if ( !hDC )
			{
				MessageBox( NULL, &quot;Failed on BeginPaint&quot;, &quot;Error&quot;, MB_OK );
				ExitProcess(1);
			}

			MemDC = CreateCompatibleDC(hDC);
			if ( !MemDC )
			{
				MessageBox( NULL, &quot;Picture not found&quot;, &quot;Error&quot;, MB_OK );
				ExitProcess(1);
			}

			if ( ! SelectObject(MemDC, hbmp) )
			{
				MessageBox( NULL, &quot;Failed on SelectObject&quot;, &quot;Error&quot;, MB_OK );
				ExitProcess(1);
			}

			BitBlt(hDC, 0, 0, r.right, r.bottom, MemDC, 0, 0, SRCCOPY);
			DeleteDC(MemDC);
     		EndPaint(hWnd, &amp;Ps);
		break;

		default:
	    return DefWindowProc(hWnd, Msg, wParam, lParam);
    }
    return 0;
}
</code></pre>
<p><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/1318565</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1318565</guid><dc:creator><![CDATA[proggingmania]]></dc:creator><pubDate>Wed, 04 Jul 2007 21:57:55 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Thu, 05 Jul 2007 17:12:59 GMT]]></title><description><![CDATA[<p>COOL danke <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="🙂"
    /> ... hab mir nämlich jetzt was ausgedacht , über die konsole wird ne win application aufgerufen wo dann imma bild vom CHarakter und Monster drin ist und über die Konsole kann man die attacken und alles ausführen <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="🙂"
    /> glaubst du das geht ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1319101</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1319101</guid><dc:creator><![CDATA[Toa]]></dc:creator><pubDate>Thu, 05 Jul 2007 17:12:59 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Thu, 05 Jul 2007 18:55:33 GMT]]></title><description><![CDATA[<p>Ja das geht.<br />
Du kannst aus einer Konsolenanwendung ganz einfach ein Fenster aufmachen wenn du möchtest, kein Problem.<br />
p.S.: wenn du wirklich ne eigene app aufrufen willst nur um das bild anzuzeigen, ja das geht auch, bloss wäre es mir zuviel aufwand.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1319168</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1319168</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Thu, 05 Jul 2007 18:55:33 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Thu, 05 Jul 2007 18:57:36 GMT]]></title><description><![CDATA[<p>btw. schrieb:</p>
<blockquote>
<p>es gibt ein undokumentieres flag für CreateConsoleScreenBuffer mit dem man bilder in der konsole darstellen kann.</p>
</blockquote>
<p>richtig! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1319169</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1319169</guid><dc:creator><![CDATA[pale dog]]></dc:creator><pubDate>Thu, 05 Jul 2007 18:57:36 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Thu, 05 Jul 2007 20:16:34 GMT]]></title><description><![CDATA[<p>pale dog schrieb:</p>
<blockquote>
<p>btw. schrieb:</p>
<blockquote>
<p>es gibt ein undokumentieres flag für CreateConsoleScreenBuffer mit dem man bilder in der konsole darstellen kann.</p>
</blockquote>
<p>richtig! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
</blockquote>
<p>Das geht dann ohne CreateDC und ohne BitBlt ??</p>
<p>Denn MSDN schreibt:<br />
dwFlags<br />
[in] Type of console screen buffer to create. The only supported screen buffer type is CONSOLE_TEXTMODE_BUFFER.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1319243</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1319243</guid><dc:creator><![CDATA[proggingmania]]></dc:creator><pubDate>Thu, 05 Jul 2007 20:16:34 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Thu, 05 Jul 2007 20:20:29 GMT]]></title><description><![CDATA[<p>Toa schrieb:</p>
<blockquote>
<p>COOL danke <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="🙂"
    /> ... hab mir nämlich jetzt was ausgedacht , über die konsole wird ne win application aufgerufen wo dann imma bild vom CHarakter und Monster drin ist und über die Konsole kann man die attacken und alles ausführen <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="🙂"
    /> glaubst du das geht ?</p>
</blockquote>
<p>Ja, das geht, aber wie hustbaer schon geschrieben hat, es ist etwas umständlicher als mit einem Windowsprogramm.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1319250</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1319250</guid><dc:creator><![CDATA[proggingmania]]></dc:creator><pubDate>Thu, 05 Jul 2007 20:20:29 GMT</pubDate></item><item><title><![CDATA[Reply to BIlder in Konsole includen klappt 50 % on Thu, 05 Jul 2007 20:29:03 GMT]]></title><description><![CDATA[<p>proggingmania schrieb:</p>
<blockquote>
<p>pale dog schrieb:</p>
<blockquote>
<p>btw. schrieb:</p>
<blockquote>
<p>es gibt ein undokumentieres flag für CreateConsoleScreenBuffer mit dem man bilder in der konsole darstellen kann.</p>
</blockquote>
<p>richtig! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
</blockquote>
<p>Das geht dann ohne CreateDC und ohne BitBlt ??</p>
</blockquote>
<p>ja, ich weiss aber nicht mehr genau wie. ist ein undokumentiertes feature, das einen teil des console windows grafikfähig macht (die grafik überlebt überlappungen und verschiebungen). in den geleakten win2k-sources findet du ein beispiel (die bekommste mit shareaza, emule oder sowas). wenn nicht: such im internet nach der email adresse von 'therese stowell'. die gute frau hat das verbrochen <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/1319259</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1319259</guid><dc:creator><![CDATA[pale dog]]></dc:creator><pubDate>Thu, 05 Jul 2007 20:29:03 GMT</pubDate></item></channel></rss>