<?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[Drag + Drop]]></title><description><![CDATA[<p>hallo,</p>
<p>ich habe einen Dialog in dem ich ein Groupbox definiert hab die Drag&amp;Drop Fähig ist (WS_EX_ACCEPTFILES).</p>
<p>Nun hab ich in meiner Callbackfunktion des Dialoges die WM_DROPFILES: eingebaut, allerdings passiert nichts wenn ich im debugger einen breakpoint in diesen caseblock setze. Scheint also etwas zu fehlen, da die WM nicht ausgelöst wird.</p>
<p>der Dialog selbst kommt aus einer ressource und hab ich in VC Editor zusammen geklickt. Die Groupbox füge ich zur laufzeit hinzu.</p>
<p>Die Große Preisfrage ist jetzt was fehlt, ich hab leider nicht wirklich viel glück beim googeln gehabt das wir die frage beantwortet hätte.</p>
<pre><code class="language-cpp">// DirectInputDialog.cpp : Definiert den Einstiegspunkt für die Anwendung.
//

#include &quot;stdafx.h&quot;
#include &quot;main.h&quot;
#include &quot;shellapi.h&quot;

INT_PTR CALLBACK	DialogCallback(HWND, UINT, WPARAM, LPARAM);

HWND			g_hDlg = NULL;

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{

	DialogBox(hInstance, MAKEINTRESOURCE(IDD_INPUT), NULL, DialogCallback);

	return 0;
}

// Meldungshandler für Infofeld.
INT_PTR CALLBACK DialogCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	HWND hGroupbox;
	HDROP hDropFile;
	INT_PTR	nSize, nCount, nForIndex;

	g_hDlg = hDlg;

	UNREFERENCED_PARAMETER(lParam);
	switch (message)
	{
	case WM_INITDIALOG:
		{

		hGroupbox = CreateWindowEx( WS_EX_ACCEPTFILES, L&quot;button&quot;,L&quot;Video zum splitten&quot; ,
									BS_GROUPBOX | WS_VISIBLE | WS_CHILD , 15, 40, 200, 100, hDlg, 
									(HMENU) 1000, NULL , NULL);
		return (INT_PTR)TRUE;
		}

	case WM_COMMAND:
		{
		if(LOWORD(wParam) == IDOK)
			EndDialog(hDlg,(INT_PTR)TRUE);
		break;
		}

	case WM_DROPFILES:
		{
			hDropFile = (HDROP) wParam;

			nCount = DragQueryFile(hDropFile, -1, NULL, 0);

			for (nForIndex = 0; nForIndex &lt; nCount; ++nForIndex)
			{

				if( 0 == (nSize = DragQueryFile(hDropFile, -1, NULL, 0)))
					continue;
			}

			DragFinish(hDropFile);

		}

	case WM_CLOSE:
		{
		EndDialog(hDlg,(INT_PTR)TRUE);
		break;
		}
	}
	return (INT_PTR)FALSE;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/170336/drag-drop</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Apr 2026 16:07:14 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/170336.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 14 Jan 2007 16:25:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Drag + Drop on Sun, 14 Jan 2007 16:25:41 GMT]]></title><description><![CDATA[<p>hallo,</p>
<p>ich habe einen Dialog in dem ich ein Groupbox definiert hab die Drag&amp;Drop Fähig ist (WS_EX_ACCEPTFILES).</p>
<p>Nun hab ich in meiner Callbackfunktion des Dialoges die WM_DROPFILES: eingebaut, allerdings passiert nichts wenn ich im debugger einen breakpoint in diesen caseblock setze. Scheint also etwas zu fehlen, da die WM nicht ausgelöst wird.</p>
<p>der Dialog selbst kommt aus einer ressource und hab ich in VC Editor zusammen geklickt. Die Groupbox füge ich zur laufzeit hinzu.</p>
<p>Die Große Preisfrage ist jetzt was fehlt, ich hab leider nicht wirklich viel glück beim googeln gehabt das wir die frage beantwortet hätte.</p>
<pre><code class="language-cpp">// DirectInputDialog.cpp : Definiert den Einstiegspunkt für die Anwendung.
//

#include &quot;stdafx.h&quot;
#include &quot;main.h&quot;
#include &quot;shellapi.h&quot;

INT_PTR CALLBACK	DialogCallback(HWND, UINT, WPARAM, LPARAM);

HWND			g_hDlg = NULL;

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{

	DialogBox(hInstance, MAKEINTRESOURCE(IDD_INPUT), NULL, DialogCallback);

	return 0;
}

// Meldungshandler für Infofeld.
INT_PTR CALLBACK DialogCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	HWND hGroupbox;
	HDROP hDropFile;
	INT_PTR	nSize, nCount, nForIndex;

	g_hDlg = hDlg;

	UNREFERENCED_PARAMETER(lParam);
	switch (message)
	{
	case WM_INITDIALOG:
		{

		hGroupbox = CreateWindowEx( WS_EX_ACCEPTFILES, L&quot;button&quot;,L&quot;Video zum splitten&quot; ,
									BS_GROUPBOX | WS_VISIBLE | WS_CHILD , 15, 40, 200, 100, hDlg, 
									(HMENU) 1000, NULL , NULL);
		return (INT_PTR)TRUE;
		}

	case WM_COMMAND:
		{
		if(LOWORD(wParam) == IDOK)
			EndDialog(hDlg,(INT_PTR)TRUE);
		break;
		}

	case WM_DROPFILES:
		{
			hDropFile = (HDROP) wParam;

			nCount = DragQueryFile(hDropFile, -1, NULL, 0);

			for (nForIndex = 0; nForIndex &lt; nCount; ++nForIndex)
			{

				if( 0 == (nSize = DragQueryFile(hDropFile, -1, NULL, 0)))
					continue;
			}

			DragFinish(hDropFile);

		}

	case WM_CLOSE:
		{
		EndDialog(hDlg,(INT_PTR)TRUE);
		break;
		}
	}
	return (INT_PTR)FALSE;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1209784</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1209784</guid><dc:creator><![CDATA[c-nooby]]></dc:creator><pubDate>Sun, 14 Jan 2007 16:25:41 GMT</pubDate></item><item><title><![CDATA[Reply to Drag + Drop on Sun, 14 Jan 2007 16:32:36 GMT]]></title><description><![CDATA[<p>Groubboxen verhalten sich im allgemeinen Transparent gegebnüber Maus Aktionen. Sie eignet sich also nicht für Drag-Accept. Du könntest das lösen in dem Du die Groupbox subclasses und bei WM_NCHITTEST HTCLIENT returnierst. Muss es eine Groupbox sein?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1209787</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1209787</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sun, 14 Jan 2007 16:32:36 GMT</pubDate></item><item><title><![CDATA[Reply to Drag + Drop on Sun, 14 Jan 2007 17:05:04 GMT]]></title><description><![CDATA[<p>Martin Richter schrieb:</p>
<blockquote>
<p>Groubboxen verhalten sich im allgemeinen Transparent gegebnüber Maus Aktionen. Sie eignet sich also nicht für Drag-Accept. Du könntest das lösen in dem Du die Groupbox subclasses und bei WM_NCHITTEST HTCLIENT returnierst. Muss es eine Groupbox sein?</p>
</blockquote>
<p>Muss nicht, aber ich find es optisch ganz nett wenn man die datei einfach in den groubbox bereich reinfallen lassen könnte.</p>
<p>subclasses müsste ich mir mal anschauen, höre ich das erstemal.....danke soweit.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1209802</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1209802</guid><dc:creator><![CDATA[c-nooby]]></dc:creator><pubDate>Sun, 14 Jan 2007 17:05:04 GMT</pubDate></item><item><title><![CDATA[Reply to Drag + Drop on Tue, 16 Jan 2007 18:18:14 GMT]]></title><description><![CDATA[<p>da bin ich wieda, klemmt wieder. ich hab dieses beispiel gefunden für Drag+Drop: <a href="http://www.winapi.net/index.php?inhalt=s41" rel="nofollow">http://www.winapi.net/index.php?inhalt=s41</a></p>
<p>Das hab ich dann bei mir so umgesetzt:</p>
<p>Leider gelingt es mir aber nicht den dateinamen der datei abzufragen, ich krieg immer nur ein 'C' als Dateinamen geliefert, woran könnte das liegen?</p>
<pre><code class="language-cpp">// DirectInputDialog.cpp : Definiert den Einstiegspunkt für die Anwendung.
//

#include &quot;stdafx.h&quot;
#include &quot;main.h&quot;
#include &quot;shellapi.h&quot;

INT_PTR CALLBACK	DialogCallback(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK    GroupBoxProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);

HWND			g_hDlg = NULL;
static LONG_PTR PrevWndProcEdit;

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{

	DialogBox(hInstance, MAKEINTRESOURCE(IDD_INPUT), NULL, DialogCallback);

	return 0;
}

// Meldungshandler für Infofeld.
INT_PTR CALLBACK DialogCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	HWND hGroupbox;
	g_hDlg = hDlg;
	HDROP		hDropFile;
	INT_PTR		nSize, nCount, nForIndex;
	wchar_t*	pszFileName;

	UNREFERENCED_PARAMETER(lParam);
	switch (message)
	{
	case WM_INITDIALOG:
		{

		hGroupbox = CreateWindowEx( WS_EX_ACCEPTFILES, L&quot;button&quot;,L&quot;Video zum splitten&quot; ,
									BS_GROUPBOX | WS_VISIBLE | WS_CHILD , 15, 40, 200, 100, hDlg, 
									(HMENU) 1000, NULL , NULL);

		PrevWndProcEdit = SetWindowLongPtr(hGroupbox, GWLP_WNDPROC, (LONG_PTR) GroupBoxProc);

		return (INT_PTR)TRUE;
		}

	case WM_COMMAND:
		{
		if(LOWORD(wParam) == IDOK)
			EndDialog(hDlg,(INT_PTR)TRUE);
		break;
		}

	case WM_DROPFILES:
		{
		hDropFile = (HDROP) wParam;

		nCount = DragQueryFile(hDropFile, (UINT) -1, NULL, 0);

		for (nForIndex = 0; nForIndex &lt; nCount; ++nForIndex)
		{

			if( 0 == (nSize = DragQueryFile(hDropFile, (UINT) -1, NULL, 0)))
				continue;

			pszFileName = new wchar_t[++nSize];

			if(DragQueryFile(hDropFile, static_cast&lt;UINT&gt;(nForIndex), pszFileName, static_cast&lt;UINT&gt;(nSize))) // Dateinamen ermitteln
            {
				MessageBox(hDlg, pszFileName, L&quot;Tara&quot;, MB_OK | MB_ICONEXCLAMATION);   
            }

			delete []pszFileName; pszFileName = NULL;
		}

		DragFinish(hDropFile);
		break;  
		}

	case WM_CLOSE:
		{
		EndDialog(hDlg,(INT_PTR)TRUE);
		break;
		}
	}
	return (INT_PTR)FALSE;
}

LRESULT CALLBACK GroupBoxProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message)
	{
	case WM_DROPFILES:
		{
			return (SendMessage(GetParent(hwnd), message, wParam, lParam));
		}
	default:
		break;
	}

	return CallWindowProc ((WNDPROC) PrevWndProcEdit, hwnd, message, wParam, lParam);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1210943</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210943</guid><dc:creator><![CDATA[c-nooby]]></dc:creator><pubDate>Tue, 16 Jan 2007 18:18:14 GMT</pubDate></item><item><title><![CDATA[Reply to Drag + Drop on Tue, 16 Jan 2007 18:28:58 GMT]]></title><description><![CDATA[<p>hat sich erledigt......sobald man um hilfe ruft sieht man es wie den hellen punkt in der nacht.....danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1210947</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1210947</guid><dc:creator><![CDATA[c-nooby]]></dc:creator><pubDate>Tue, 16 Jan 2007 18:28:58 GMT</pubDate></item></channel></rss>