<?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&amp;amp;Drop Explorer -&amp;gt; ListBox]]></title><description><![CDATA[<p>Hallo zusammen</p>
<p>Ich möchte per Drag&amp;Drop Dateien in ein ListBox ziehen.<br />
Ich kenne das Beispiel aus der FAQ.<br />
Wenn ich dies einbinde funktioniert auch alles, allerdings reagiert dann das gesamte Formular auf Drag&amp;Drop. Ich möchte allerdings nur das die ListBox darauf reagiert.<br />
Wenn ich nun anstatt</p>
<p>DragAcceptFiles(Form1-&gt;Handle,true);</p>
<p>DragAcceptFiles(ListBox1-&gt;Handle,true);</p>
<p>schreibe. Ändert sich zwar der Cursor nur noch auf der ListBox, allerdings die WmDropFiles(TWMDropFiles&amp; Message) Funktion wird nicht mehr ausgeführt.</p>
<p>MfG Stephan</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/101057/drag-amp-drop-explorer-gt-listbox</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Jul 2026 09:57:36 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/101057.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 12 Feb 2005 21:32:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Drag&amp;amp;Drop Explorer -&amp;gt; ListBox on Sat, 12 Feb 2005 21:32:14 GMT]]></title><description><![CDATA[<p>Hallo zusammen</p>
<p>Ich möchte per Drag&amp;Drop Dateien in ein ListBox ziehen.<br />
Ich kenne das Beispiel aus der FAQ.<br />
Wenn ich dies einbinde funktioniert auch alles, allerdings reagiert dann das gesamte Formular auf Drag&amp;Drop. Ich möchte allerdings nur das die ListBox darauf reagiert.<br />
Wenn ich nun anstatt</p>
<p>DragAcceptFiles(Form1-&gt;Handle,true);</p>
<p>DragAcceptFiles(ListBox1-&gt;Handle,true);</p>
<p>schreibe. Ändert sich zwar der Cursor nur noch auf der ListBox, allerdings die WmDropFiles(TWMDropFiles&amp; Message) Funktion wird nicht mehr ausgeführt.</p>
<p>MfG Stephan</p>
]]></description><link>https://www.c-plusplus.net/forum/post/721806</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/721806</guid><dc:creator><![CDATA[_Stephan_]]></dc:creator><pubDate>Sat, 12 Feb 2005 21:32:14 GMT</pubDate></item><item><title><![CDATA[Reply to Drag&amp;amp;Drop Explorer -&amp;gt; ListBox on Sat, 12 Feb 2005 21:42:07 GMT]]></title><description><![CDATA[<p>Hallo zusammen</p>
<p>Nachtrag:<br />
Die ListBox befindet sich in einem PageControl.</p>
<p>MfG Stephan</p>
]]></description><link>https://www.c-plusplus.net/forum/post/721809</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/721809</guid><dc:creator><![CDATA[_Stephan_]]></dc:creator><pubDate>Sat, 12 Feb 2005 21:42:07 GMT</pubDate></item><item><title><![CDATA[Reply to Drag&amp;amp;Drop Explorer -&amp;gt; ListBox on Sat, 12 Feb 2005 22:12:46 GMT]]></title><description><![CDATA[<p>Hast du die neu geschriebene Nachrichtenbehandlungsroutine auch der ListBox und nicht dem Formular zugewiesen? Sonst wird es wohl nicht klappen.</p>
<p>Gruß, Oli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/721823</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/721823</guid><dc:creator><![CDATA[der oli]]></dc:creator><pubDate>Sat, 12 Feb 2005 22:12:46 GMT</pubDate></item><item><title><![CDATA[Reply to Drag&amp;amp;Drop Explorer -&amp;gt; ListBox on Sat, 12 Feb 2005 23:16:10 GMT]]></title><description><![CDATA[<p>public in der h:</p>
<pre><code class="language-cpp">BEGIN_MESSAGE_MAP
        MESSAGE_HANDLER(WM_DROPFILES,TWMDropFiles,WmDropFiles)
        END_MESSAGE_MAP(TForm)
</code></pre>
<p>private in der h:</p>
<pre><code class="language-cpp">void __fastcall WmDropFiles(TWMDropFiles&amp; Message);
</code></pre>
<p>und in der cpp hab ich</p>
<pre><code class="language-cpp">void __fastcall TfrmMain::WmDropFiles(TWMDropFiles&amp; Message)
{
  char buff[MAX_PATH];
  HDROP hDrop=(HDROP)Message.Drop;
  int numFiles=DragQueryFile(hDrop,-1,NULL,NULL);
  for(int i=0;i&lt;numFiles;i++)
  {
    DragQueryFile(hDrop,i,buff,sizeof(buff));
    String szExt=ExtractFileExt(buff);
    if(szExt==&quot;.cpp&quot;||szExt==&quot;.hpp&quot;||
       szExt==&quot;.c&quot;  ||szExt==&quot;.h&quot;  ||
       szExt==&quot;.cxx&quot;||szExt==&quot;.hxx&quot;)
    {
      ltbFiles1-&gt;Items-&gt;Insert(ltbFiles1-&gt;Items-&gt;Count,buff);
    }
  }
  DragFinish(hDrop);
}
</code></pre>
<p>halt die endungen (szExt) kannst du natürlich ändern, ltbFiles1 ist die ListBox.<br />
und der akzeptiert files aus dem explorer! mal ausprobiern</p>
]]></description><link>https://www.c-plusplus.net/forum/post/721849</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/721849</guid><dc:creator><![CDATA[Blackhawk]]></dc:creator><pubDate>Sat, 12 Feb 2005 23:16:10 GMT</pubDate></item><item><title><![CDATA[Reply to Drag&amp;amp;Drop Explorer -&amp;gt; ListBox on Sun, 13 Feb 2005 08:52:11 GMT]]></title><description><![CDATA[<p>Na toll, das ist doch genau das, was in der FAQ steht!?</p>
<p>_Stephan_:<br />
M.E. musst du dafür eine Komponente von TListBox (oder was immer das Ziel sein soll) ableiten und WM_DROPFILES schon dort abfangen.</p>
<p>Oder du suchst dir bei <a href="http://torry.net" rel="nofollow">torry.net</a> o.ä. was fertiges.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/721935</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/721935</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Sun, 13 Feb 2005 08:52:11 GMT</pubDate></item><item><title><![CDATA[Reply to Drag&amp;amp;Drop Explorer -&amp;gt; ListBox on Sun, 13 Feb 2005 09:14:47 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/52">@Jansen</a>: ich hab nur das gepostet, was ich hab, und bei mir gehts ja so!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/721959</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/721959</guid><dc:creator><![CDATA[Blackhawk]]></dc:creator><pubDate>Sun, 13 Feb 2005 09:14:47 GMT</pubDate></item><item><title><![CDATA[Reply to Drag&amp;amp;Drop Explorer -&amp;gt; ListBox on Sun, 13 Feb 2005 10:46:02 GMT]]></title><description><![CDATA[<p>Ja, das geht grundsätzlich, das hatte _Stephan_ ja auch schon geschrieben.<br />
Bei dieser Lösung &quot;akzeptieren&quot; aber auch die Form selbst und sämtliche darauf befindliche Controls per DnD empfangene Dateien. Wie man letzteres verhindert, das ist Thema dieses Threads.</p>
<p>Setzen, Sechs!</p>
<p><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/722030</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722030</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Sun, 13 Feb 2005 10:46:02 GMT</pubDate></item><item><title><![CDATA[Reply to Drag&amp;amp;Drop Explorer -&amp;gt; ListBox on Sun, 13 Feb 2005 14:09:01 GMT]]></title><description><![CDATA[<p>*scnr* jansen hat gewonnen <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>vlt musst du das WmDropFiles irgendwie in TListBox unterkriegen?</p>
<p>[edit] wenns bei dem Private von der TForm so ist und dann die ganze form reagiert, wirds wohl so sein!<br />
[edit2] wenn du WmDropFiles bei TForm1 reinmachst reagiert auch nur Form1 drauf ^^<br />
und wenn du dann Drag'n'Drop nicht mit TForm1 machst dann geht halt nix <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/722077</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722077</guid><dc:creator><![CDATA[Blackhawk]]></dc:creator><pubDate>Sun, 13 Feb 2005 14:09:01 GMT</pubDate></item><item><title><![CDATA[Reply to Drag&amp;amp;Drop Explorer -&amp;gt; ListBox on Sun, 13 Feb 2005 18:03:27 GMT]]></title><description><![CDATA[<p>Hallo zusammen</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/52">@Jansen</a><br />
Deine Idee mit dem ableiten von der Komponente war richtig, es funktioniert.</p>
<p>Vielen dank für eure Hilfe.</p>
<p>MfG Stephan</p>
]]></description><link>https://www.c-plusplus.net/forum/post/722404</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/722404</guid><dc:creator><![CDATA[_Stephan_]]></dc:creator><pubDate>Sun, 13 Feb 2005 18:03:27 GMT</pubDate></item></channel></rss>