<?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[Pointer auf Window Proc]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich würde einer Klasse von mir gerne einen Zeiger auf eine &quot;Window Proc&quot; übergeben damit diese übergebene Funktion in der WNDCLASS, welche sich in meiner Klasse befindet nutzen zu können.</p>
<p>Kann mir da jemand ein Beispiel geben wie ich das mache.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/148410/pointer-auf-window-proc</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Jul 2026 06:04:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/148410.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 26 May 2006 12:35:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Pointer auf Window Proc on Fri, 26 May 2006 12:35:08 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich würde einer Klasse von mir gerne einen Zeiger auf eine &quot;Window Proc&quot; übergeben damit diese übergebene Funktion in der WNDCLASS, welche sich in meiner Klasse befindet nutzen zu können.</p>
<p>Kann mir da jemand ein Beispiel geben wie ich das mache.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1065459</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1065459</guid><dc:creator><![CDATA[nichtAngemeldeterGast]]></dc:creator><pubDate>Fri, 26 May 2006 12:35:08 GMT</pubDate></item><item><title><![CDATA[Reply to Pointer auf Window Proc on Fri, 26 May 2006 12:36:46 GMT]]></title><description><![CDATA[<p><a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39356.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-39356.html</a> <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/1065460</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1065460</guid><dc:creator><![CDATA[faq]]></dc:creator><pubDate>Fri, 26 May 2006 12:36:46 GMT</pubDate></item><item><title><![CDATA[Reply to Pointer auf Window Proc on Fri, 26 May 2006 14:48:12 GMT]]></title><description><![CDATA[<p>hi so könnte man es zzum beispiel machen</p>
<pre><code class="language-cpp">#include &quot;Windows.h&quot;
#include &quot;tchar.h&quot;

class CWindow {
	HINSTANCE	m_hInstance;
	HWND		m_hWnd;

	TCHAR		m_szWindowName[64];

	BOOL m_RegisterClass( void );
	static LRESULT CALLBACK m_WndProc(HWND, UINT,WPARAM,LPARAM);
public:
	CWindow( LPTSTR lpWindowName, UINT nWidth = CW_USEDEFAULT, UINT nHeight = CW_USEDEFAULT );
};

CWindow::CWindow( LPTSTR lpWindowName, UINT nWidth, UINT nHeight )
{
	m_hInstance = GetModuleHandle(0);
	_tcscpy( m_szWindowName, lpWindowName );

	m_RegisterClass();

	m_hWnd		= CreateWindow( &quot;CWindowClass&quot;, lpWindowName,
								WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT,
								nWidth, nHeight, NULL, NULL, m_hInstance, this );

	ShowWindow( m_hWnd, SW_SHOW );
	UpdateWindow( m_hWnd );

}

LRESULT CALLBACK CWindow::m_WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
	CWindow *pThis = (CWindow*) GetWindowLong( hWnd, GWL_USERDATA );

	switch(uMsg)
	{
		case WM_CREATE:
			pThis = (CWindow*) ((LPCREATESTRUCT)lParam)-&gt;lpCreateParams;
			SetWindowLong( hWnd, GWL_USERDATA, (LONG)pThis );
			break;

		case WM_LBUTTONDOWN:
			MessageBox( pThis-&gt;m_hWnd, pThis-&gt;m_szWindowName, &quot;Hallo&quot;, MB_OK );
			break;

		case WM_DESTROY:
			PostQuitMessage(0);
			return 0;
	}

	return DefWindowProc( hWnd, uMsg, wParam, lParam ); 
}

BOOL CWindow::m_RegisterClass( void )
{
	WNDCLASSEX  wndclass;

	wndclass.cbSize			= sizeof(wndclass);
	wndclass.style			= CS_HREDRAW | CS_VREDRAW;
	wndclass.cbClsExtra		= 0;
	wndclass.cbWndExtra		= 0;
	wndclass.hIcon			= LoadIcon(0, IDI_APPLICATION);
	wndclass.hCursor		= LoadCursor (NULL, IDC_ARROW);
	wndclass.hbrBackground	= (HBRUSH)(COLOR_BTNFACE + 1);
	wndclass.lpszMenuName	= NULL;
	wndclass.hIconSm		= NULL;
	wndclass.lpszClassName	= &quot;CWindowClass&quot;;

	wndclass.lpfnWndProc	= CWindow::m_WndProc;
	wndclass.hInstance		= m_hInstance;

	return RegisterClassEx(&amp;wndclass); 
}

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
	MSG msg;

 	// TODO: Place code here.
	CWindow Test( &quot;Test Fenster 1&quot;, 200, 50 );
	CWindow Lol( &quot;Test Fenster 2&quot;, 300, 300 );

	while (GetMessage(&amp;msg, NULL, 0, 0))
	{
		TranslateMessage(&amp;msg);
		DispatchMessage(&amp;msg);
	}

	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1065575</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1065575</guid><dc:creator><![CDATA[Stefan50]]></dc:creator><pubDate>Fri, 26 May 2006 14:48:12 GMT</pubDate></item><item><title><![CDATA[Reply to Pointer auf Window Proc on Fri, 26 May 2006 17:47:18 GMT]]></title><description><![CDATA[<p>Vorischt damit, den Instanzzeiger in CWindow::m_WndProc einfach so mittels GetWindowLong zu holen. Erstmal ist GetWindowLongPtr/SetWindowLongPtr geeigneter. Und zweitens ist WM_CREATE _nicht_ die erste Nachricht. Dh, pThis wird vorher noch einige male ein Nullzeiger und Dereferenzieren führt somit unweigerlich zu Problemen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1065710</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1065710</guid><dc:creator><![CDATA[groovemaster]]></dc:creator><pubDate>Fri, 26 May 2006 17:47:18 GMT</pubDate></item><item><title><![CDATA[Reply to Pointer auf Window Proc on Fri, 16 Jun 2006 06:06:01 GMT]]></title><description><![CDATA[<p>Hi</p>
<p>Wie kann man diese Lösung für einen modalen Dialog umsetzen?<br />
Ich muss den Dialog dann ja vermutlich mit CreateWindowEx erzeugen oder bekommt man das auch mit DialogBoxParam() oder einer anderen Funktion hin?</p>
<p>Irgendwie muss ich ja den Spericher reservieren und nach meinen momentanen Kenntnissen geht das nur über CreateWindow() bzw CreateWindowEx().</p>
<p>Dank und Schönen Gruß,<br />
Pedro.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1078637</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1078637</guid><dc:creator><![CDATA[SanPedro]]></dc:creator><pubDate>Fri, 16 Jun 2006 06:06:01 GMT</pubDate></item><item><title><![CDATA[Reply to Pointer auf Window Proc on Fri, 16 Jun 2006 08:05:33 GMT]]></title><description><![CDATA[<p>Wieso, das geht doch genauso wenn du DialogBoxParam benutzt. Der letzte Parameter dwInitParam wird als lParam bei WM_INITDIALOG übergeben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1078675</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1078675</guid><dc:creator><![CDATA[Ranner]]></dc:creator><pubDate>Fri, 16 Jun 2006 08:05:33 GMT</pubDate></item></channel></rss>