<?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[[changeTopic]...]]></title><description><![CDATA[<p>Hey @ll.<br />
nightmareMines(sowas wie Minesweeper) geht vorran, allerdings habe ich ein problem, wo ich mir nicht unbedingt sicher bin ob es lösbar ist.</p>
<p>Ich habe ein Fenster, in dem sind 1225 Childs(2D HWND arr. Buttons).</p>
<p>Ich will nun einen Rechtsklick auf eines dieser Fenster mitbekommen, um eine spezielle Funktion auszuführen.</p>
<p>Programmiersprache: C, wobei das wohl eher egal ist!?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/205145/changetopic</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 16:45:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/205145.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 11 Feb 2008 08:46:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [changeTopic]... on Tue, 12 Feb 2008 14:13:47 GMT]]></title><description><![CDATA[<p>Hey @ll.<br />
nightmareMines(sowas wie Minesweeper) geht vorran, allerdings habe ich ein problem, wo ich mir nicht unbedingt sicher bin ob es lösbar ist.</p>
<p>Ich habe ein Fenster, in dem sind 1225 Childs(2D HWND arr. Buttons).</p>
<p>Ich will nun einen Rechtsklick auf eines dieser Fenster mitbekommen, um eine spezielle Funktion auszuführen.</p>
<p>Programmiersprache: C, wobei das wohl eher egal ist!?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453450</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453450</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Tue, 12 Feb 2008 14:13:47 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 09:17:45 GMT]]></title><description><![CDATA[<p>Und was ist deine Frage :)?<br />
Da ja alle Buttons das selbe tun müssen. Wäre wohl das einfachste eine wndproc zu schreiben und alle Buttons auf diese wndproc zu subclassen.</p>
<p>schirrmie</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453459</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453459</guid><dc:creator><![CDATA[schirrmie]]></dc:creator><pubDate>Mon, 11 Feb 2008 09:17:45 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 09:26:36 GMT]]></title><description><![CDATA[<p>Danke...</p>
<p>Wie Subclasse ich?<br />
Hab ich noch nie gemacht.</p>
<p>Bei einem klick auf den Button sollen sie eigetntlich nur verschwinden(SW_HIDE) und bei einem rechtsklick sollen alle nur nen Text bekommen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453464</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453464</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 11 Feb 2008 09:26:36 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 09:41:37 GMT]]></title><description><![CDATA[<p>WM_RBUTTONDOWN/-UP</p>
<p>Hatten wir das nicht schon mal?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453471</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453471</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Mon, 11 Feb 2008 09:41:37 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 10:11:58 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/11581">@Elektronix</a>: Kennst du dich in der WINAPI aus? Ja schätze schon du hast mir viel erzählt... Mich wundert dein Post. Diese Message bekomme ich nicht, wenn ich auf Childs klicke, nur wenn ich auf mein Fenster klicke.</p>
<p>So die sind jetzt &quot;gesubclasst&quot; und jetzt kommt schon das erste: sie sind durchsichig, also dahinter steht ein Text, und dieser Text ist sichtbar!?<br />
Wie kommt das? Ansonsten schonmal dickes danke, da(neue wndproc) funktionierts mit RBUTTONUP, jetzt muss ich funktionalitäten übernehmen.</p>
<p>[edit] kkann es sein, das der text, der in WM_PAINT von dem Hauptfenster (wo die buttons erzeugt werden), einfaach nur drübergelegt wird?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453474</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453474</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 11 Feb 2008 10:11:58 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 10:52:02 GMT]]></title><description><![CDATA[<p>Sorry. Unter <a href="http://WinAPI.net" rel="nofollow">WinAPI.net</a> gab es mal ein gutes Codeschnipsel zu Subclassing. Leider ist die Seite nicht mehr verfügbar. <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="😞"
    /> Genaueres kann ich Dir heute Abend erst sagen, hab mir das mal ausgedruckt, aber z. Zt. nicht zur Hand. (Vermutlich sind andere Forianer schneller).)</p>
<p>Wie der Button bzw. das gesubclasste Fenster aussieht, legst Du in CreateWindowEx fest, mit dem 2. Parameter (LPCTSTR lpClassName) (bei CreateWindow ist das der 1. Parameter). Dort einfach &quot;Button&quot; eingeben.</p>
<blockquote>
<p>The CreateWindow function creates an overlapped, pop-up, or child window. It specifies the window class, window title, window style, and (optionally) the initial position and size of the window. The function also specifies the window's parent or owner, if any, and the window's menu.</p>
<p>HWND CreateWindow(</p>
<p>LPCTSTR lpClassName, // pointer to registered class name<br />
LPCTSTR lpWindowName, // pointer to window name<br />
DWORD dwStyle, // window style<br />
int x, // horizontal position of window<br />
int y, // vertical position of window<br />
int nWidth, // window width<br />
int nHeight, // window height<br />
HWND hWndParent, // handle to parent or owner window<br />
HMENU hMenu, // handle to menu or child-window identifier<br />
HANDLE hInstance, // handle to application instance<br />
LPVOID lpParam // pointer to window-creation data<br />
);<br />
(...)<br />
Class Meaning<br />
BUTTON Designates a small rectangular child window that represents a button the user can click to turn it on or off. Button controls can be used alone or in groups, and they can either be labeled or appear without text. Button controls typically change appearance when the user clicks them.</p>
</blockquote>
<p>Außerdem gibst Du für den Parameter dwStyle BS_PUSHBUTTON ein.</p>
<blockquote>
<p>BS_PUSHBUTTON Creates a push button that posts a WM_COMMAND message to the owner window when the user selects the button.</p>
</blockquote>
<p>Dann schreibst Du eine entsprechend ButtonProc dazu, die WM_RBUTTONDOWN/UP bearbeitet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453506</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453506</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Mon, 11 Feb 2008 10:52:02 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 11:51:21 GMT]]></title><description><![CDATA[<p>Meine Ironie schrieb:</p>
<blockquote>
<p>Ließt du einen meiner Beiträge?<br />
Ich wundere mich wieder, denn du schreibst so als wüsste ich nicht,<br />
a. wie ich einen Button erzeuge (da werden 1225 automatisch erzeugt, müsste reichen)<br />
b. das ich in einer eigenen Klasse ButtonUP behandeln soll.<br />
Bist du spät Schlafen gegangen <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>
</blockquote>
<p>Also nochmal:<br />
Ich habe gefragt wie man Subclasst, das hatte sich erledigt.<br />
Das mit Button UP hatte ich auch schon geschrieben,<br />
die verbleibende Frage ist:</p>
<p><em>Wieso wird TextOut aus dem Hauptfenster ÜBER die ganzen Buttons(die ja Childs sind) gelegt?</em></p>
<p>Es ist sinnfrei Minesweeper zu Spielen wenn man schon sieht wo welche Mienen/Zahlen/Freiflächen sind. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453545</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453545</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 11 Feb 2008 11:51:21 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 11:54:54 GMT]]></title><description><![CDATA[<p>Guck dir mal die Nachricht WM_CONTEXTMEnU oder so ähnlich an, aheb gerade kein PSDK da, um mal schnell nachschlagen zu können.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453547</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453547</guid><dc:creator><![CDATA[_Luckie]]></dc:creator><pubDate>Mon, 11 Feb 2008 11:54:54 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 12:06:30 GMT]]></title><description><![CDATA[<p>lippoliv schrieb:</p>
<blockquote>
<p><em>Wieso wird TextOut aus dem Hauptfenster ÜBER die ganzen Buttons(die ja Childs sind) gelegt?</em></p>
<p>Es ist sinnfrei Minesweeper zu Spielen wenn man schon sieht wo welche Mienen/Zahlen/Freiflächen sind. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
</blockquote>
<p>Vermutlich, weil Du die Buttons bei WM_CREATE erzeugst, den Text aber bei WM_PAINT, und die kommt NACH WM_CREATE. Also wird der Text NACH den Buttons geschrieben, und damit logischerweise über die Buttons.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453552</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453552</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Mon, 11 Feb 2008 12:06:30 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 12:10:51 GMT]]></title><description><![CDATA[<p><strong>Liebe leute: Die letze offene frage ist kursiv geschrieben, die anderen sind gelöst.</strong><br />
Oder sollte mir _Luckies Beitrag bei dem Schriftproblem helfen?</p>
<p>Eine neue Frage:</p>
<pre><code class="language-cpp">icon = LoadImage( NULL, &quot;./flag.ico&quot;, IMAGE_ICON, 32, 32, LR_LOADFROMFILE );
if( 0 == SendMessage( myWnd, BM_SETIMAGE, IMAGE_ICON, (WPARAM)icon ) )
	printf( &quot;nio\n&quot; );
</code></pre>
<p>HANDLE icon;<br />
HWND myWnd;</p>
<p>Wieso bekomme ich da immer nio?</p>
<p>[edit]@Elektronix: Danke für dienen Post, allerdings muss ich anmerken, bevor ich gesubbclasst habe, ging alles... Also ohne sichtbaren Text...</p>
<pre><code class="language-cpp">LRESULT CALLBACK WndProc( HWND myWnd, UINT wndMsg, WPARAM wParam, LPARAM lParam )
/*
	This function will recieve all messages, wich where send by windows to this window.
*/
{
	bool visitMsg = false;
	int x,
		y,
		aktXPos,
		aktYPos,
		tmpX,
		tmpY;
	HDC myHdc;
	PAINTSTRUCT myPaint;
	char zahl;

	x = y = aktXPos = aktYPos = 0;

	switch( wndMsg )
	{
		case WM_CREATE:					//on window creation
			for( y = 0; y &lt; Yaxe; y++ )		//create all Buttons
			{
				for( x = 0; x &lt; Xaxe; x++ )
				{
					mines[y][x] = CreateWindow( &quot;BUTTON&quot;, &quot;&quot;, WS_CHILD | WS_VISIBLE | WS_DLGFRAME, aktXPos, aktYPos, buttonX, buttonY, myWnd, (HMENU)bmMine, ((LPCREATESTRUCT)lParam)-&gt;hInstance, NULL );
					SetWindowLong( mines[y][x], GWL_WNDPROC, (LONG)myBtn );
					aktXPos += buttonX;					//generate the position of the new button
				}
				aktYPos += buttonY;
				aktXPos = 0;
			}
			for( y = 0; y &lt; numberOfMines; y++ )	//generate the mine infos, so that there are some mines in the game.
			{
				do
				{
					tmpX = zufall( 0, Xaxe*10 );
					tmpY = zufall( 0, Yaxe*10 );
				}while( isMine( tmpX/10, tmpY/10 ) );
				arrayOfMines[y][1] = tmpX/10;
				arrayOfMines[y][2] = tmpY/10;
			}
			visitMsg = true;
		break;
		case WM_PAINT:
			myHdc = BeginPaint( myWnd, &amp;myPaint );
			{
				for( y = 0; y &lt; numberOfMines; y++ )	//write down the mines
				{
					TextOut( myHdc, arrayOfMines[y][1]*buttonX+3, arrayOfMines[y][2]*buttonY, &quot;X&quot;, 1 );
				}

				for( y = 0; y &lt; Yaxe; y++ )			//create the number of mines for a field
				{
					for( x = 0; x &lt; Xaxe; x++ )
					{
						if( !isMine( x, y ) &amp;&amp; countMines( x, y ) &gt; 0 )
						{
							itoa( countMines( x, y ), &amp;zahl, 10 );

							TextOut( myHdc, x*buttonX+4, y*buttonY, &amp;zahl, 1 );
						}
					}
				}
			}
			EndPaint( myWnd, &amp;myPaint );
			visitMsg = true;
		break;
		case WM_CLOSE:
			deleteList();						//delete the list
			PostQuitMessage( 0 );
		break;
	}
	if( !visitMsg )
		return DefWindowProc( myWnd, wndMsg, wParam, lParam );

	return visitMsg;
}
</code></pre>
<p>ist das ausreichend?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453554</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453554</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 11 Feb 2008 12:10:51 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 12:54:57 GMT]]></title><description><![CDATA[<p>du bist nett und verdienst hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453592</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453592</guid><dc:creator><![CDATA[~ironie~]]></dc:creator><pubDate>Mon, 11 Feb 2008 12:54:57 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 13:04:47 GMT]]></title><description><![CDATA[<p>Es tut mir leid wenn ich ein wenig unfreundlich wirke, ich versuch mein bestes, aber eine sache verstehe ich nicht: wieso Postet man was, ohne wenigstens den letzten und vorletzten beitrag zu lesen?</p>
<p>Kann mir noch wer helfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453602</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453602</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 11 Feb 2008 13:04:47 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 13:10:44 GMT]]></title><description><![CDATA[<p>lippoliv schrieb:</p>
<blockquote>
<p><strong>Liebe leute: Die letze offene frage ist kursiv geschrieben, die anderen sind gelöst.</strong><br />
Oder sollte mir _Luckies Beitrag bei dem Schriftproblem helfen?</p>
</blockquote>
<p>Was für in Schriftproblem?</p>
<blockquote>
<p>Ich will nun einen Rechtsklick auf eines dieser Fenster mitbekommen, um eine spezielle Funktion auszuführen.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1453608</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453608</guid><dc:creator><![CDATA[_Luckie]]></dc:creator><pubDate>Mon, 11 Feb 2008 13:10:44 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 13:22:54 GMT]]></title><description><![CDATA[<p>lippoliv schrieb:</p>
<blockquote>
<p>Die verbleibende Frage ist:</p>
<p><em>Wieso wird TextOut aus dem Hauptfenster ÜBER die ganzen Buttons(die ja Childs sind) gelegt?</em></p>
<p>Es ist sinnfrei Minesweeper zu Spielen wenn man schon sieht wo welche Mienen/Zahlen/Freiflächen sind. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
</blockquote>
<p>^^12:51 Uhr<br />
Dein Zitat stammt aus dem ersten Beitrag, der schon ein wenig veraltet ist, es haben sich neue Probleme aufgetan, und um nicht unsinnig irgendwelche Threads aufzumachen, habe ich die Fragen dierekt hier gepostet. <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>
<p>MFG und danke für alle bisherigen Posts...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453617</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453617</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 11 Feb 2008 13:22:54 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 13:43:23 GMT]]></title><description><![CDATA[<p>Warum prüfst du denn nicht ob der Button weg ist und schreibst nur dann den Text und nicht immer.</p>
<p>schirrmie</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453631</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453631</guid><dc:creator><![CDATA[schirrmie]]></dc:creator><pubDate>Mon, 11 Feb 2008 13:43:23 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 13:46:23 GMT]]></title><description><![CDATA[<p>lippoliv schrieb:</p>
<blockquote>
<p><em>Wieso wird TextOut aus dem Hauptfenster ÜBER die ganzen Buttons(die ja Childs sind) gelegt?</em></p>
</blockquote>
<p>Weil Du selbst drüber malst! Was erwartest Du?<br />
Sollte Dir als Antwort genügen <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>Ansonsten solltest Du einfach mal die MSDN Doku lesen, was ein DC ist und was es bedeutet wenn Child Windows einen DC bekommen. Wann diese geclippt werden und das dies nicht der Normalfall ist. Siehe Doku zu WS_CLIPCHILDREN...</p>
<p>Grundlektüre für das Anlegen von Fenstern...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453635</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453635</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 11 Feb 2008 13:46:23 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 14:09:18 GMT]]></title><description><![CDATA[<p>@schrimme, siehe mein topic &quot;ist mein button SW_HIDE&quot;, da bekam ich keine antwort und keiner verstand warum ich sowas machen wollte(war anderer zusammenhang, aber das hat mich geprägt)</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/35992">@Martin</a>: Ich erwarte das sich die &quot;STAY_ON_TOP&quot; verhältnisse (oder wie auch immer die heißen) sich nicht verändern, nur weil ich etwas subclasse, oder ist das zuviel erwartet?<br />
Was ist clippen? Naja MSDN wirds mir bestimmt mitteilen...</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453656</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453656</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 11 Feb 2008 14:09:18 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 14:13:36 GMT]]></title><description><![CDATA[<p>wie sieht denn dein subclass aus?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453663</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453663</guid><dc:creator><![CDATA[schirrmie]]></dc:creator><pubDate>Mon, 11 Feb 2008 14:13:36 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 14:19:28 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">regStandardWnd( hInstance, &quot;myButton&quot;, (WNDPROC)myBtn, (HBRUSH)COLOR_BTNFACE )&lt;&lt;aufruf
[...]
bool regStandardWnd( HINSTANCE hInst, char *name, WNDPROC procedure, HBRUSH color )&lt;&lt;standardfunktion
/*
	This function registers a standard Window
*/
{
	WNDCLASSEX wndMain;

	wndMain.cbSize = sizeof(WNDCLASSEX);
	wndMain.style = CS_HREDRAW | CS_VREDRAW;

	wndMain.lpfnWndProc = procedure;						//if there is an incomming message

	wndMain.cbClsExtra = 0;									//extra memory for the class
	wndMain.cbWndExtra = 0;									//extra memory for the window

	wndMain.hInstance = hInst;								//handle from that instance, wich the window belong to

	wndMain.hIcon = LoadIcon( NULL, IDI_APPLICATION );		//Program icon (set to std)
	wndMain.hCursor = LoadCursor( NULL, IDC_ARROW );		//the cursor, wich schould been used in this program

	wndMain.hbrBackground = color;		//background of the window

	wndMain.lpszMenuName = NULL;							//there is no menue

	wndMain.lpszClassName = name;							//application name

	wndMain.hIconSm = LoadIcon( NULL, IDI_APPLICATION );	//smal Icon( eventually the tray-icon )

	return RegisterClassEx( &amp;wndMain );						//register the class, return the 
}
[...]
LRESULT CALLBACK myBtn( HWND myWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
	bool visit = false;
	int x = 0,
		y = 0;
	HANDLE icon;
	switch( msg )
	{
		case WM_LBUTTONUP:
			[...]
		break;
		case WM_RBUTTONUP:
			[...]
		break;
	}
	if( !visit )
		return DefWindowProc( myWnd, msg, wParam, lParam );

	return visit;
}
</code></pre>
<p>Meintest du dass?<br />
Wenn nicht einfach genauer werden, dann poste ich alles... Ahso:</p>
<pre><code class="language-cpp">for( y = 0; y &lt; Yaxe; y++ )		//create all Buttons
{
	for( x = 0; x &lt; Xaxe; x++ )
	{
		mines[y][x] = CreateWindow( &quot;BUTTON&quot;, &quot;&quot;, WS_CHILD | WS_VISIBLE | WS_DLGFRAME, aktXPos, aktYPos, buttonX, buttonY, myWnd, (HMENU)bmMine, ((LPCREATESTRUCT)lParam)-&gt;hInstance, NULL );
		SetWindowLong( mines[y][x], GWL_WNDPROC, (LONG)myBtn );
		aktXPos += buttonX;					//generate the position of the new button
	}
	aktYPos += buttonY;
	aktXPos = 0;
}
</code></pre>
<p>HWND mines[Yaxe][Xaxe] //2D - Array of HWND<br />
Hoffe die Variablen sprechen für sich...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453672</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453672</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 11 Feb 2008 14:19:28 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 14:28:45 GMT]]></title><description><![CDATA[<p>Hmm deine neue wndproc sieht komisch aus! Und du speicherst dir nicht die alte wndproc adresse und schreibst sie beim Beenden nicht wieder zurück!</p>
<p>Hier das war das tut von <a href="http://win-api.de" rel="nofollow">win-api.de</a> guck dir das an und probier das.</p>
<pre><code>#include &lt;windows.h&gt;
static LONG_PTR PrevWndProcEdit;

// Hauptnachrichtenschleife
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   static HWND hwndEditAlt;

   switch (message)
   {
   case WM_CREATE:
// Editfeld erzeugen
      hwndEditAlt = CreateWindow(&quot;EDIT&quot;,&quot;&quot;,WS_VISIBLE|WS_CHILD|WS_BORDER,20,20,100,30,
                           hwnd,0,((LPCREATESTRUCT)lParam)-&gt;hInstance,0);
// Den ursprünglichen WND-PROC Pointer sichern und durch den eigenen ersetzen.
      PrevWndProcEdit = SetWindowLongPtr (hwndEditAlt, GWLP_WNDPROC, 
                                (LONG_PTR) EditWndProc);
      return 0;

   case WM_DESTROY:
// Den ursprünglichen Pointer wieder einsetzen
      SetWindowLongPtr (hwndEditAlt, GWLP_WNDPROC, PrevWndProcEdit);
      PostQuitMessage (0);
      return 0;
   }

return DefWindowProc (hwnd, message, wParam, lParam);
}

// Die neue WND-PROC für das Editfeld
LRESULT CALLBACK EditWndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
   switch (message)
   {
      case WM_CHAR:
         MessageBox (NULL, &quot;Taste!&quot;, &quot;Tasteneingabe im Editfeld&quot;, NULL);
// stünde hier ein &quot;return 0;&quot; würde keine Taste im Editfeld erscheinen!
         break;  
   }

return CallWindowProc ((WNDPROC) PrevWndProcEdit, hwnd, message, wParam, lParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1453687</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453687</guid><dc:creator><![CDATA[schirrmie]]></dc:creator><pubDate>Mon, 11 Feb 2008 14:28:45 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 14:31:07 GMT]]></title><description><![CDATA[<p>DANKE MARTIN... JEA...</p>
<p>Muss man die wieder umschreiben? Warum, das Window wird ja eh zerstört...</p>
<p>PS: es klappt jetzt übrigens... Jetzt noch dedr SET_IMAGE SenMessage fehler weg und man kann spielen.. Ich meld mich bestimmt wieder <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="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453690</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453690</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 11 Feb 2008 14:31:07 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 14:33:49 GMT]]></title><description><![CDATA[<p>lippoliv schrieb:</p>
<blockquote>
<p>Muss man die wieder umschreiben? Warum, das Window wird ja eh zerstört...</p>
</blockquote>
<p>Jaja schon klar und ein free/delete brauch man in einem Programm ja auch nicht, das Programm wird ja eh irgendwann wieder geschlossen, ne <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453695</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453695</guid><dc:creator><![CDATA[schirrmie]]></dc:creator><pubDate>Mon, 11 Feb 2008 14:33:49 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 14:36:35 GMT]]></title><description><![CDATA[<p>Achso und wegen dem hier</p>
<blockquote>
<p>Eine neue Frage:</p>
<pre><code>icon = LoadImage( NULL, &quot;./flag.ico&quot;, IMAGE_ICON, 32, 32, LR_LOADFROMFILE );
if( 0 == SendMessage( myWnd, BM_SETIMAGE, IMAGE_ICON, (WPARAM)icon ) )
    printf( &quot;nio\n&quot; );
</code></pre>
</blockquote>
<p>Warum prüfst du erst bei SendMesage und nicht schon bei LoadImage, falls es an LoadImage liegt dann guck dir GetLastError an!</p>
<p>schirrmie</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453698</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453698</guid><dc:creator><![CDATA[schirrmie]]></dc:creator><pubDate>Mon, 11 Feb 2008 14:36:35 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Mon, 11 Feb 2008 14:54:25 GMT]]></title><description><![CDATA[<p>free/delete(wofür auch immer delete ist): Im grunde schon, allerdings kann das wohl irgendwie fehler verursachen, und es dauert eine weile bis windows den Speciehr wieder frei gibt. Das Fenster ist doch im Grunde wie eine Variable, das System macht nach Programmende ncihts mehr damit oder wie?(Ich suche eine erklärung, nicht lediglich &quot;Jaja shcon klar*ironie*&quot;...)</p>
<p>LoadImage kann (wie bei mir aktuell) gut gehen, und SendMessage Fehlschlagen...</p>
<p>An mich: Wieso vergesse ich immer GetLastError... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /></p>
<p>Danke dir, ich werde da mal nachschauen...</p>
<p>€dit: &quot;0&quot;(successfull) ist die ausgabe von GetLastError, ein Icon wird nicht angezeigt:</p>
<pre><code class="language-cpp">flag = LoadImage( NULL, &quot;flag.ico&quot;, IMAGE_ICON, buttonX, buttonY, LR_DEFAULTCOLOR | LR_LOADFROMFILE );
[...]
case WM_RBUTTONUP:
	if( !isEnd )
	{
		icon = (HANDLE)SendMessage( myWnd, BM_GETIMAGE, IMAGE_ICON, (WPARAM)NULL );
		if( icon != flag)
		{
			if( NULL == (HANDLE)SendMessage( myWnd, BM_SETIMAGE, IMAGE_ICON, (WPARAM)flag ) )
				printf( &quot;%d; fialure &quot;, GetLastError() );
			printf( &quot;disable\n&quot; );
		}
		else
		{
			printf( &quot;enable\n&quot; );
			SendMessage( myWnd, BM_SETIMAGE, IMAGE_ICON, (WPARAM)NULL );
		}
		visit = true;
	}
break;
</code></pre>
<p>if( clickedButtonIsMine ) -&gt; isEnd = true;<br />
HANDLE icon;<br />
glob. HANDLE flag;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453711</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453711</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Mon, 11 Feb 2008 14:54:25 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Tue, 12 Feb 2008 07:38:02 GMT]]></title><description><![CDATA[<p>lippoliv schrieb:</p>
<blockquote>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/35992">@Martin</a>: Ich erwarte das sich die &quot;STAY_ON_TOP&quot; verhältnisse (oder wie auch immer die heißen) sich nicht verändern, nur weil ich etwas subclasse, oder ist das zuviel erwartet?</p>
</blockquote>
<p>Stay on top gilt nicht für CHild Windows. (Wieder etwas was man durch Lesen erfahren kan!)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1453802</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1453802</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 12 Feb 2008 07:38:02 GMT</pubDate></item><item><title><![CDATA[Reply to [changeTopic]... on Tue, 12 Feb 2008 07:36:12 GMT]]></title><description><![CDATA[<p>Naja, aber irgendwie schon, denn bevor ich sie subgeclasst habe, waren sie ja quasi STAY_ON_TOP (in meinem Fenster) und WM_PAINT hat alles dahinter gelegt.</p>
<p>Allerdings funktioniert das mit dem Bild auf dem Button noch nicht, da werd ich noch mal schauen, da die Operation nach GetLastError ja funktioniert hat.<br />
Aber zu diesem Thema werde ich -hoffentlich- in diesem Forum vieles finden / einen neuen Thread aufmachen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1454118</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1454118</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Tue, 12 Feb 2008 07:36:12 GMT</pubDate></item></channel></rss>