<?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[ListView mit bewegbaren Items (per Mausklick)]]></title><description><![CDATA[<p>Guten Abend!</p>
<p>Werde demnächst ein ListView-ähnliches Control brauchen, deren Items der User mit der Maus verschieben kann.</p>
<p>Habt ihr ne Idee wie man sowas bewerkstelligen kann. Gibt's Tutorials?</p>
<p>MfG,<br />
Aziz</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/64922/listview-mit-bewegbaren-items-per-mausklick</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Apr 2026 03:35:02 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/64922.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 14 Feb 2004 20:42:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ListView mit bewegbaren Items (per Mausklick) on Sat, 14 Feb 2004 20:42:54 GMT]]></title><description><![CDATA[<p>Guten Abend!</p>
<p>Werde demnächst ein ListView-ähnliches Control brauchen, deren Items der User mit der Maus verschieben kann.</p>
<p>Habt ihr ne Idee wie man sowas bewerkstelligen kann. Gibt's Tutorials?</p>
<p>MfG,<br />
Aziz</p>
]]></description><link>https://www.c-plusplus.net/forum/post/459517</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/459517</guid><dc:creator><![CDATA[Aziz]]></dc:creator><pubDate>Sat, 14 Feb 2004 20:42:54 GMT</pubDate></item><item><title><![CDATA[Reply to ListView mit bewegbaren Items (per Mausklick) on Sun, 15 Feb 2004 00:45:54 GMT]]></title><description><![CDATA[<p>*Push*</p>
<p>Ist sehr wichtig. Wäre für Tipps sehr dankbar <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/459595</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/459595</guid><dc:creator><![CDATA[Aziz]]></dc:creator><pubDate>Sun, 15 Feb 2004 00:45:54 GMT</pubDate></item><item><title><![CDATA[Reply to ListView mit bewegbaren Items (per Mausklick) on Sun, 15 Feb 2004 02:55:29 GMT]]></title><description><![CDATA[<p>So wie auf dem Windows Desktop? Aber das ist doch ein ListView.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/459622</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/459622</guid><dc:creator><![CDATA[WebFritzi]]></dc:creator><pubDate>Sun, 15 Feb 2004 02:55:29 GMT</pubDate></item><item><title><![CDATA[Reply to ListView mit bewegbaren Items (per Mausklick) on Sun, 15 Feb 2004 12:41:08 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Nein nicht mit den großen Icons. So wie in einem TreeView Control, aber ohne Hierarchie und Icons (naja wär nicht schlimm). Die Items bestehen nur aus Text und werden untereinander gestapelt..</p>
<p>Z.B.:</p>
<pre><code>*----------*
* |Text 1| *
* |Text 2| *
* |Text 3| *
*----------*
</code></pre>
<p>Ich möchte jetzt, dass der User die Items mit der Maus bewegen kann. Muss ich diese Funktionalität selber programmieren, oder gibt es etwas Fertiges, oder etwas anderes in der Richtung, w.z.B. ein Tutorial, das einen Ansatz zeigt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/459759</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/459759</guid><dc:creator><![CDATA[Aziz]]></dc:creator><pubDate>Sun, 15 Feb 2004 12:41:08 GMT</pubDate></item><item><title><![CDATA[Reply to ListView mit bewegbaren Items (per Mausklick) on Sun, 15 Feb 2004 17:25:05 GMT]]></title><description><![CDATA[<p>Es gibt jede Menge Tutorials, die erklären wie man Items von einer ListBox in die andere per Drag&amp;Drop verschieben kann.<br />
Ich möchte aber nur, dass die Items in der selben ListBox mit der Maus nach oben und nach unten verschiebbar sind.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/459942</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/459942</guid><dc:creator><![CDATA[Aziz]]></dc:creator><pubDate>Sun, 15 Feb 2004 17:25:05 GMT</pubDate></item><item><title><![CDATA[Reply to ListView mit bewegbaren Items (per Mausklick) on Mon, 16 Feb 2004 20:37:07 GMT]]></title><description><![CDATA[<p>Kommt schon Leute, hat noch nie jemand soetwas programmiert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/460697</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/460697</guid><dc:creator><![CDATA[Aziz]]></dc:creator><pubDate>Mon, 16 Feb 2004 20:37:07 GMT</pubDate></item><item><title><![CDATA[Reply to ListView mit bewegbaren Items (per Mausklick) on Tue, 24 Feb 2004 16:18:55 GMT]]></title><description><![CDATA[<p>Glau nicht. Normale Styles und Funktionen gibts auf jeden Fall nicht. Musst Du manuell machen per Drag and Drop, die genau Position in der Liste des Mauszeigers &quot;beim Loslassen&quot; des Items holen und dort in die liste &quot;einfügen&quot;... etc.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/466956</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/466956</guid><dc:creator><![CDATA[ChrisK]]></dc:creator><pubDate>Tue, 24 Feb 2004 16:18:55 GMT</pubDate></item><item><title><![CDATA[Reply to ListView mit bewegbaren Items (per Mausklick) on Fri, 05 Mar 2004 21:31:50 GMT]]></title><description><![CDATA[<p>Hallo allerseits!</p>
<p>Ich poste wie immer die Lösung für ein Problem, das ich selber später lösen konnte:</p>
<p>Entgegen der Behauptung von ChrisK gibt es eine Funtion, die für den Programmierer die Mühe abnimmt Drag&amp;Drop-Funktionalität bei Listboxen zu implementieren.</p>
<p>Man erzeugt eine simple ListBox und übergibt dessen Window-Handle folgender Funktion:</p>
<pre><code class="language-cpp">BOOL MakeDragList(HWND hLB);
</code></pre>
<p>Ich habe dazu ein Beispiel auf einer Seite gefunden, die nur in der japanischen Sprache verfügbar ist (deshalb auch diese merkwürdigen Fragezeichen im Code): <a href="http://www.kumei.ne.jp/c_lang/sdk3/sdk_215.htm" rel="nofollow">http://www.kumei.ne.jp/c_lang/sdk3/sdk_215.htm</a></p>
<pre><code class="language-cpp">//        draglst1.cpp

#include &lt;windows.h&gt;
#include &lt;windowsx.h&gt;
#include &lt;commctrl.h&gt;

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
ATOM InitApp(HINSTANCE);
BOOL InitInstance(HINSTANCE, int);

char szClassName[] = &quot;draglst1&quot;;    //????????

int WINAPI WinMain(HINSTANCE hCurInst, HINSTANCE hPrevInst,
                   LPSTR lpsCmdLine, int nCmdShow)
{
    MSG msg;

    if (!InitApp(hCurInst))
        return FALSE;
    if (!InitInstance(hCurInst, nCmdShow)) 
        return FALSE;
    while (GetMessage(&amp;msg, NULL, 0, 0)) {
        TranslateMessage(&amp;msg);
        DispatchMessage(&amp;msg);
    }
    return msg.wParam;
}

ATOM InitApp(HINSTANCE hInst)
{
    WNDCLASSEX wc;
    wc.cbSize = sizeof(WNDCLASSEX);
    wc.style = CS_HREDRAW | CS_VREDRAW;
    wc.lpfnWndProc = WndProc;    //???????
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = hInst;//??????
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
    wc.lpszMenuName = NULL;    //?????
    wc.lpszClassName = (LPCSTR)szClassName;
    wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
    return (RegisterClassEx(&amp;wc));
}

BOOL InitInstance(HINSTANCE hInst, int nCmdShow)
{
    HWND hWnd;

    hWnd = CreateWindow(szClassName,
            &quot;?????????????&quot;, //??????????????????
            WS_OVERLAPPEDWINDOW, //????????
            CW_USEDEFAULT,    //X??
            CW_USEDEFAULT,    //Y??
            230,//?
            140,//??
            NULL, //???????????????????NULL
            NULL, //??????????????????????NULL
            hInst, //??????????
            NULL);
    if (!hWnd)
        return FALSE;
    ShowWindow(hWnd, nCmdShow);
    UpdateWindow(hWnd);
    return TRUE;
}

//???????????

LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
{
    int id;
    static HWND hList;
    static HINSTANCE hInst;
    LPCREATESTRUCT lpc;
    INITCOMMONCONTROLSEX ic;
    static UINT drgMsg;
    static LPDRAGLISTINFO lpd;
    UINT nMsg;
    static int nDragItem = -1, nListID;
    char szData[64];

    if (msg == drgMsg) {
        lpd = (LPDRAGLISTINFO)lp;
        nMsg = lpd-&gt;uNotification;
        switch (nMsg) {
            case DL_BEGINDRAG:
                nDragItem = LBItemFromPt(lpd-&gt;hWnd, lpd-&gt;ptCursor, TRUE);
                return TRUE;
            case DL_DRAGGING:
                nListID = LBItemFromPt(lpd-&gt;hWnd, lpd-&gt;ptCursor, TRUE);
                DrawInsert(hWnd, lpd-&gt;hWnd, nListID);
                if (nListID != -1) {
                    SetCursor(LoadCursor(hInst, &quot;MYDRAG&quot;));
                    return 0;
                }
                return DL_STOPCURSOR;
            case DL_CANCELDRAG:
                nDragItem = -1;
                break;
            case DL_DROPPED:
                nListID = LBItemFromPt(lpd-&gt;hWnd, lpd-&gt;ptCursor, TRUE);
                if (nListID != -1) {
                    ListBox_GetText(hList, nDragItem, szData);
                    ListBox_DeleteString(hList, nDragItem);
                    ListBox_InsertString(hList, nListID, szData);
                    ListBox_SetCurSel(hList, nListID);
                }
                DrawInsert(hWnd, lpd-&gt;hWnd, -1);
                nDragItem = -1;
                break;
        }
    }
    switch (msg) {
        case WM_CREATE:
            ic.dwSize = sizeof(INITCOMMONCONTROLSEX);
            ic.dwICC = ICC_WIN95_CLASSES;
            InitCommonControlsEx(&amp;ic);
            lpc = (LPCREATESTRUCT)lp;
            hInst = lpc-&gt;hInstance;
            hList = CreateWindowEx(0, &quot;LISTBOX&quot;, &quot;&quot;,
                WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL,
                10, 10, 200, 100, hWnd, (HMENU)100, 
                hInst, NULL);
            MakeDragList(hList);
            drgMsg = RegisterWindowMessage(DRAGLISTMSGSTRING);
            ListBox_AddString(hList, &quot;1?????&quot;);
            ListBox_AddString(hList, &quot;2?????&quot;);
            ListBox_AddString(hList, &quot;3?????&quot;);
            ListBox_AddString(hList, &quot;4?????&quot;);
            ListBox_AddString(hList, &quot;5?????&quot;);
            ListBox_AddString(hList, &quot;6?????&quot;);
            break;
        case WM_CLOSE:
            id = MessageBox(hWnd,
                &quot;??????????&quot;,
                &quot;????&quot;,
                MB_YESNO | MB_ICONQUESTION);
            if (id == IDYES) {
                DestroyWindow(hList);
                DestroyWindow(hWnd);
            }
            break;
        case WM_DESTROY:
            PostQuitMessage(0);
            break;
        default:
            return (DefWindowProc(hWnd, msg, wp, lp));
    }
    return 0;
}
</code></pre>
<p>Näheres erfährt ihr in der MSDN; hier der Online-Link: <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/draglb/reflist.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/draglb/reflist.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/474158</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/474158</guid><dc:creator><![CDATA[Aziz]]></dc:creator><pubDate>Fri, 05 Mar 2004 21:31:50 GMT</pubDate></item><item><title><![CDATA[Reply to ListView mit bewegbaren Items (per Mausklick) on Sat, 06 Mar 2004 10:59:16 GMT]]></title><description><![CDATA[<p>Danke, das ist auch für mich interessant!<br />
Ich stoße auch total oft auf diese japanischen Seiten, aber die haben glaube ich so ziemlich alles dokumentiert, voll krass <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="🙂"
    /><br />
Die Japaner sind halt immer voraus...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/474366</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/474366</guid><dc:creator><![CDATA[ChrisK]]></dc:creator><pubDate>Sat, 06 Mar 2004 10:59:16 GMT</pubDate></item></channel></rss>