<?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[Über Button ein anderer Cursor]]></title><description><![CDATA[<p>Hi<br />
ich würde gerne über einem button einen anderen aursor anzeigen lassen.<br />
weiß da zufällig jemand wie das funktioniert?<br />
danke <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/topic/228491/über-button-ein-anderer-cursor</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 19:22:39 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/228491.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 28 Nov 2008 22:10:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Fri, 28 Nov 2008 22:10:10 GMT]]></title><description><![CDATA[<p>Hi<br />
ich würde gerne über einem button einen anderen aursor anzeigen lassen.<br />
weiß da zufällig jemand wie das funktioniert?<br />
danke <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/1622668</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622668</guid><dc:creator><![CDATA[Santa]]></dc:creator><pubDate>Fri, 28 Nov 2008 22:10:10 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Fri, 28 Nov 2008 22:32:05 GMT]]></title><description><![CDATA[<p>Soweit ich weiß, kannst du einfach die WM_SETCURSOR-Nachricht abfangen, welche bei Maus-Eintritt an den Button geschickt wird, und daraufhin SetCursor(...) aufrufen <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/1622676</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622676</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Fri, 28 Nov 2008 22:32:05 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Fri, 28 Nov 2008 23:10:02 GMT]]></title><description><![CDATA[<p>wenn ich - ohne jegliche kontrollstrukturen um zu testen um welches hwnd es sich handelt - einfach nur SetCursor in WM_SETCURSOR verwende entählt das gesamte fenster diesen cursor.<br />
wenn ich allerdings über den button gehe sehe ich den ganz normalen pfeil <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":-("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1622687</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622687</guid><dc:creator><![CDATA[Santa]]></dc:creator><pubDate>Fri, 28 Nov 2008 23:10:02 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Fri, 28 Nov 2008 23:26:24 GMT]]></title><description><![CDATA[<p>Du sollst doch natürlich die Nachricht des Buttons und nicht des Fensters abfangen <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1622691</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622691</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Fri, 28 Nov 2008 23:26:24 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Fri, 28 Nov 2008 23:31:23 GMT]]></title><description><![CDATA[<p>Ähh..<br />
über subclassing, oder wie jetzt?...</p>
<p>PS: vielen dank für deine bisherigen bemühungen <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1622693</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622693</guid><dc:creator><![CDATA[Santa]]></dc:creator><pubDate>Fri, 28 Nov 2008 23:31:23 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Fri, 28 Nov 2008 23:58:27 GMT]]></title><description><![CDATA[<p>Santa schrieb:</p>
<blockquote>
<p>Ähh..<br />
über subclassing, oder wie jetzt?...</p>
<p>PS: vielen dank für deine bisherigen bemühungen <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>
</blockquote>
<p>Ja genau, subclassing! Und gern geschehen <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="🙂"
    /> Ich hatte vor ein paar Monaten auch mal lange danach gesucht, vorher kannte ich nur die Methode, eine eigene Fensterklasse zu erstellen (via RegisterClass/Ex) und da halt einen Cursor-Typ anzugeben - ist natürlich ungleich aufwändiger.</p>
<p>edit:</p>
<p>MSDN schrieb:</p>
<blockquote>
<p>The DefWindowProc function passes the WM_SETCURSOR message to a parent window before processing. If the parent window returns TRUE, further processing is halted. Passing the message to a window's parent window gives the parent window control over the cursor's setting in a child window.</p>
</blockquote>
<p>Vielleicht braucht man doch kein Subclassing. Kannst ja mal versuchen über den HWND-wParam die Child-ID zu holen und so halt dementsprechend den Cursor zu setzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1622698</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622698</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Fri, 28 Nov 2008 23:58:27 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Sat, 29 Nov 2008 10:38:12 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">WM_SETCURSOR:
    if(wparam == GetDlgItem(hwnd, mybutton) {
        //MessageBoxA(hwnd, &quot;Hallo&quot;, &quot;WM_SETCURSOR&quot;, MB_OK);
        SetCursor(mycursor);
    }
    return true;
</code></pre>
<p>Ich habe das nun so, die nacrhicht erhalte ich, also die messagebox erscheint, aber der cursor bleibt unverändert <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1622793</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622793</guid><dc:creator><![CDATA[Santa]]></dc:creator><pubDate>Sat, 29 Nov 2008 10:38:12 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Sat, 29 Nov 2008 10:50:37 GMT]]></title><description><![CDATA[<p>Bei mir klappts :p<br />
<a href="http://rafb.net/p/YaOCcU24.html" rel="nofollow">http://rafb.net/p/YaOCcU24.html</a></p>
<p>Sicher, dass dein Cursor richtig geladen wurde?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1622798</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622798</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Sat, 29 Nov 2008 10:50:37 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Sat, 29 Nov 2008 11:01:15 GMT]]></title><description><![CDATA[<p>ich habs genau so und bei mir funktioniert es nicht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":-("
      alt="😞"
    /></p>
<p>(nur mit dem unterschied das ich meinen dialog mit CreateDialog und einer resource erstelle)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1622803</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622803</guid><dc:creator><![CDATA[Santa]]></dc:creator><pubDate>Sat, 29 Nov 2008 11:01:15 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Sat, 29 Nov 2008 11:07:03 GMT]]></title><description><![CDATA[<p>Zeig einfach mal den wichtigsten Source, das macht die Diagnose bestimmt leicher <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/1622804</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622804</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Sat, 29 Nov 2008 11:07:03 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Sat, 29 Nov 2008 11:37:22 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;windows.h&gt;

MSG msg;

BOOL FensterProzedur(HWND hwnd, int Msg, DWORD wParam, DWORD lParam) {
    switch(Msg) {
    case WM_SETCURSOR:
        if(wParam == GetDlgItem(hwnd, mybutton) {
            SetCursor(LoadCursor(0, 32649));
        }
        return TRUE;
    }
    return FALSE;
}

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ) {
    CreateDialog(GetModuleHandle(NULL), IDD_MAIN, 0, &amp;FensterProzedur);
    while(GetMessage(&amp;msg, 0, 0)) {
        TranslateMessage(&amp;msg);
        DispatchMessage(&amp;msg);
    }
    return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1622817</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622817</guid><dc:creator><![CDATA[Santa]]></dc:creator><pubDate>Sat, 29 Nov 2008 11:37:22 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Sat, 29 Nov 2008 12:20:54 GMT]]></title><description><![CDATA[<p>Upsi, verguckt. Aber hast du mal überprüft, ob LoadCursor ein gültiges Handle zurückgibt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1622846</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622846</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Sat, 29 Nov 2008 12:20:54 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Sat, 29 Nov 2008 12:28:54 GMT]]></title><description><![CDATA[<p>Ne mach ich jetzt mal.<br />
aber es ist ja eigentlich nur der befehl den du auch benutzt hast (LoadCursor(0,IDC_HAND), nur halt mit dem wert von IDC_HAND) deswegen wüsste ich nicht, was da schief gehen sollte, naja ich gucke mal, ob ein fehler kommt.<br />
Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1622855</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622855</guid><dc:creator><![CDATA[Santa]]></dc:creator><pubDate>Sat, 29 Nov 2008 12:28:54 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Sat, 29 Nov 2008 12:49:41 GMT]]></title><description><![CDATA[<p>Wenn der Button WM_SETCURSOR selbst behandelt, dann bekommt das Elternfenster diese Nachricht nicht zu sehen.<br />
Nutze Spy++ um das zu prüfen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1622867</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622867</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sat, 29 Nov 2008 12:49:41 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Sat, 29 Nov 2008 13:21:47 GMT]]></title><description><![CDATA[<blockquote>
<p>&lt;00119&gt; 004A02F2 S WM_SETCURSOR hwnd:004A02F2 nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE<br />
&lt;00120&gt; 004A02F2 R WM_SETCURSOR fHaltProcessing:False</p>
</blockquote>
<p>?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1622886</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622886</guid><dc:creator><![CDATA[Santa]]></dc:creator><pubDate>Sat, 29 Nov 2008 13:21:47 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Sat, 29 Nov 2008 13:50:59 GMT]]></title><description><![CDATA[<p>Santa schrieb:</p>
<blockquote>
<blockquote>
<p>&lt;00120&gt; 004A02F2 R WM_SETCURSOR fHaltProcessing:False</p>
</blockquote>
</blockquote>
<p>Da ist doch der Haken -&gt; fHaltProcessing müsste true sein. Das bedeutet, du musst zur Nachricht WM_SETCURSOR den Wert &quot;TRUE&quot; zurückgeben.</p>
<p>=&gt;</p>
<p>MSDN schrieb:</p>
<blockquote>
<p>If the dialog box procedure processes a message that requires a specific return value, the dialog box procedure should set the desired return value by calling SetWindowLong(hwndDlg, DWL_MSGRESULT, lResult) immediately before returning TRUE. Note that you must call SetWindowLong immediately before returning TRUE; doing so earlier may result in the DWL_MSGRESULT value being overwritten by a nested dialog box message.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1622901</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622901</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Sat, 29 Nov 2008 13:50:59 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Sat, 29 Nov 2008 14:04:09 GMT]]></title><description><![CDATA[<p>wo denn?</p>
<p>hier steht doch return TRUE;</p>
<pre><code class="language-cpp">case WM_SETCURSOR: 
        if(wParam == GetDlgItem(hwnd, mybutton) { 
            SetCursor(LoadCursor(0, 32649)); 
        } 
        return TRUE;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1622907</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622907</guid><dc:creator><![CDATA[Santa]]></dc:creator><pubDate>Sat, 29 Nov 2008 14:04:09 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Sat, 29 Nov 2008 14:21:52 GMT]]></title><description><![CDATA[<p>Und Deine WM_SETCURSOR Routine wird aufegrufen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1622913</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622913</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sat, 29 Nov 2008 14:21:52 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Sat, 29 Nov 2008 14:30:21 GMT]]></title><description><![CDATA[<p>ja, wenn ich da eine messagebox reinmache, erscheint sie</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1622915</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622915</guid><dc:creator><![CDATA[Santa]]></dc:creator><pubDate>Sat, 29 Nov 2008 14:30:21 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Sat, 29 Nov 2008 14:42:12 GMT]]></title><description><![CDATA[<p>Santa schrieb:</p>
<blockquote>
<p>wo denn?</p>
<p>hier steht doch return TRUE;</p>
</blockquote>
<p>Lies doch mal ein wenig Doku <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>
<p>MSDN schrieb:</p>
<blockquote>
<p>Typically, the dialog box procedure should return TRUE if it processed the message, and FALSE if it did not. If the dialog box procedure returns FALSE, the dialog manager performs the default dialog operation in response to the message.</p>
</blockquote>
<p>Dein &quot;return TRUE&quot; bedeutet nur, dass die Nachricht nicht ans Standard-Nachrichten-Bearbeitungs-System weitergeleitet wird; den Rückgabewert setzt du damit allerdings nicht. Deshalb hatte ich in meinem Post (von 14:50:59) ja den MSDN-Quote dazugenommen, wo drinsteht, wie du den Rückgabewert setzen kannst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1622918</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622918</guid><dc:creator><![CDATA[Badestrand]]></dc:creator><pubDate>Sat, 29 Nov 2008 14:42:12 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Sat, 29 Nov 2008 16:55:25 GMT]]></title><description><![CDATA[<p>Du hast hier keine Fenster Prozedur, sondern eine DlgProc!</p>
<p>Hier gibst Du TRUE und FALSE zurück und regelst ob die DefDlgProc aufegrufen wird. Um auf WM_SETCURSOR mit TRUE zu reagieren musst Du DWL_MSGRESULT verwenden und den Code wie folgt ändern:</p>
<pre><code class="language-cpp">case WM_SETCURSOR: 
        if(wParam == GetDlgItem(hwnd, mybutton) 
        { 
            SetCursor(LoadCursor(0, 32649)); 
            SetWindowLong(hDlg,DWL_MSGRESULT,TRUE);
        } 
        return TRUE;
</code></pre>
<p>BTW. Speicher Dir doch das Handle, permanent und verwnede doch besser die entsprechenden symbolischen IDs.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1622921</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622921</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sat, 29 Nov 2008 16:55:25 GMT</pubDate></item><item><title><![CDATA[Reply to Über Button ein anderer Cursor on Sat, 29 Nov 2008 15:06:53 GMT]]></title><description><![CDATA[<p>Vielen Dank euch beiden, hat wunderbar funktioniert <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><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/13210">@Badestrand</a>:<br />
tut mir leid, ich dachte ich hätte es schon gelesen und habe es deswegen mehr oder weniger ignoriert, obwohl darin die lösung steckte <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1622927</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1622927</guid><dc:creator><![CDATA[Santa]]></dc:creator><pubDate>Sat, 29 Nov 2008 15:06:53 GMT</pubDate></item></channel></rss>