<?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[Callback function]]></title><description><![CDATA[<p>wie kann ich aus der CALLBACK function aus Methoden eines Objektes aufrufen? Ich hab ja keine Möglichkeit das Objekt der funktion zu übergeben.</p>
<p>hier der code:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;tchar.h&gt;
#include &lt;iostream&gt;

class ausgabe {
	void write(TCHAR* sss) {
		_tprintf(_T(&quot;Fenster: %s\n&quot;), sss);
	}

};

BOOL CALLBACK MyEnumProc(HWND hWnd, LPARAM lParam) {
    TCHAR title[500];
    ZeroMemory(title, sizeof(title));

    if(!IsWindowVisible(hWnd)) return true;
    GetWindowText(hWnd, title, sizeof(title)/sizeof(title[0]));

    handle.write(title);

    return true;
}

int main() {	

	ausgabe handle;

	EnumWindows(MyEnumProc, 0);
    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/211172/callback-function</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 00:48:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/211172.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 19 Apr 2008 23:46:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Callback function on Sat, 19 Apr 2008 23:46:36 GMT]]></title><description><![CDATA[<p>wie kann ich aus der CALLBACK function aus Methoden eines Objektes aufrufen? Ich hab ja keine Möglichkeit das Objekt der funktion zu übergeben.</p>
<p>hier der code:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;tchar.h&gt;
#include &lt;iostream&gt;

class ausgabe {
	void write(TCHAR* sss) {
		_tprintf(_T(&quot;Fenster: %s\n&quot;), sss);
	}

};

BOOL CALLBACK MyEnumProc(HWND hWnd, LPARAM lParam) {
    TCHAR title[500];
    ZeroMemory(title, sizeof(title));

    if(!IsWindowVisible(hWnd)) return true;
    GetWindowText(hWnd, title, sizeof(title)/sizeof(title[0]));

    handle.write(title);

    return true;
}

int main() {	

	ausgabe handle;

	EnumWindows(MyEnumProc, 0);
    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1494863</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1494863</guid><dc:creator><![CDATA[C++ - Anfänger]]></dc:creator><pubDate>Sat, 19 Apr 2008 23:46:36 GMT</pubDate></item><item><title><![CDATA[Reply to Callback function on Sun, 20 Apr 2008 00:06:03 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">EnumWindows(MyEnumProc, &amp;handle);
</code></pre>
<pre><code class="language-cpp">BOOL CALLBACK MyEnumProc(HWND hWnd, LPARAM lParam)
{
     // ...
     ausgabe* pAusgabe = (ausgabe*)lParam;
     pAusgabe-&gt;write(title)
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1494866</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1494866</guid><dc:creator><![CDATA[............]]></dc:creator><pubDate>Sun, 20 Apr 2008 00:06:03 GMT</pubDate></item><item><title><![CDATA[Reply to Callback function on Sun, 20 Apr 2008 10:50:30 GMT]]></title><description><![CDATA[<p>ich bekomme eine fehlermeldung:</p>
<pre><code>..\firstdll.cpp:35: error: invalid conversion from `ausgabe*' to `LPARAM'
..\firstdll.cpp:35: error:   initializing argument 2 of `BOOL EnumWindows(BOOL (*)(HWND__*, LPARAM), LPARAM)'
</code></pre>
<p>wie kann ich die referenz meines objektes in dem objekttyp LPARAM speichern?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1494965</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1494965</guid><dc:creator><![CDATA[C++ - Anfänger]]></dc:creator><pubDate>Sun, 20 Apr 2008 10:50:30 GMT</pubDate></item><item><title><![CDATA[Reply to Callback function on Sun, 20 Apr 2008 11:15:34 GMT]]></title><description><![CDATA[<p>firstdll.cpp in firstdll.c umbenennen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1494980</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1494980</guid><dc:creator><![CDATA[truehacker]]></dc:creator><pubDate>Sun, 20 Apr 2008 11:15:34 GMT</pubDate></item><item><title><![CDATA[Reply to Callback function on Sun, 20 Apr 2008 11:21:58 GMT]]></title><description><![CDATA[<p>nein nein hier musst du auch casten aber benutz nicht diesen cpp cast mist, mach einfach so:</p>
<pre><code class="language-cpp">EnumWindows(MyEnumProc, (LPARAM)&amp;handle);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1494984</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1494984</guid><dc:creator><![CDATA[truehacker]]></dc:creator><pubDate>Sun, 20 Apr 2008 11:21:58 GMT</pubDate></item></channel></rss>