<?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[eigenes control mouse-events]]></title><description><![CDATA[<p>Hallo<br />
ich hab ein eigenes control mittels</p>
<pre><code class="language-cpp">handleInstance = instance;

    WNDCLASS wc;
    wc.style		  = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
    wc.lpfnWndProc	  = (WNDPROC)wndProc;
    wc.cbClsExtra	  = 0;
    wc.cbWndExtra	  = sizeof(DevColorControl*);
    wc.hInstance	  = getInstance();
    wc.hCursor		  = LoadCursor(NULL, IDC_ARROW);
    wc.hIcon              = NULL;
    wc.hbrBackground      = (HBRUSH)(COLOR_WINDOW+1);
    wc.lpszMenuName	  = NULL;
    string caption        = getControlClass();
    wc.lpszClassName      = caption.c_str();

    atomClass = RegisterClass(&amp;wc);
</code></pre>
<p>und</p>
<pre><code class="language-cpp">if ( instance != NULL ) handleInstance = instance;
    hwndParent = parent;

    SetLastError(0);
    CREATESTRUCT createstruct;
    // Übergeben des this-Zeiger an WM_CREATE
    createstruct.lpCreateParams = this;
    setHandle(CreateWindow(getControlClass().c_str(), getCaption().c_str(),
        getStyles(), getLeft(), getTop(), getWidth(), getHeight(), getParent(),
        NULL, getInstance(), &amp;createstruct));
</code></pre>
<p>erstellt. Das problem ist wenn ich auf das Control mit der mouse klicke, dann bekommt das parent-fenster die WM_MOUSE event. Und auch die WM_SETFOCUS wird nicht an das control geschickt. wie kann ich das machen das das control das WM_SETFOCUS und das WM_MOUSE bekommt ?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/70948/eigenes-control-mouse-events</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Apr 2026 14:29:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/70948.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 13 Apr 2004 14:47:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to eigenes control mouse-events on Tue, 13 Apr 2004 14:47:44 GMT]]></title><description><![CDATA[<p>Hallo<br />
ich hab ein eigenes control mittels</p>
<pre><code class="language-cpp">handleInstance = instance;

    WNDCLASS wc;
    wc.style		  = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
    wc.lpfnWndProc	  = (WNDPROC)wndProc;
    wc.cbClsExtra	  = 0;
    wc.cbWndExtra	  = sizeof(DevColorControl*);
    wc.hInstance	  = getInstance();
    wc.hCursor		  = LoadCursor(NULL, IDC_ARROW);
    wc.hIcon              = NULL;
    wc.hbrBackground      = (HBRUSH)(COLOR_WINDOW+1);
    wc.lpszMenuName	  = NULL;
    string caption        = getControlClass();
    wc.lpszClassName      = caption.c_str();

    atomClass = RegisterClass(&amp;wc);
</code></pre>
<p>und</p>
<pre><code class="language-cpp">if ( instance != NULL ) handleInstance = instance;
    hwndParent = parent;

    SetLastError(0);
    CREATESTRUCT createstruct;
    // Übergeben des this-Zeiger an WM_CREATE
    createstruct.lpCreateParams = this;
    setHandle(CreateWindow(getControlClass().c_str(), getCaption().c_str(),
        getStyles(), getLeft(), getTop(), getWidth(), getHeight(), getParent(),
        NULL, getInstance(), &amp;createstruct));
</code></pre>
<p>erstellt. Das problem ist wenn ich auf das Control mit der mouse klicke, dann bekommt das parent-fenster die WM_MOUSE event. Und auch die WM_SETFOCUS wird nicht an das control geschickt. wie kann ich das machen das das control das WM_SETFOCUS und das WM_MOUSE bekommt ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/500605</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/500605</guid><dc:creator><![CDATA[DEvent]]></dc:creator><pubDate>Tue, 13 Apr 2004 14:47:44 GMT</pubDate></item><item><title><![CDATA[Reply to eigenes control mouse-events on Tue, 13 Apr 2004 15:11:40 GMT]]></title><description><![CDATA[<p>moin meister ...</p>
<p>was das ?<br />
wc.lpfnWndProc = (WNDPROC)wndProc;</p>
<p>doch nicht etwa die WndProc vom Parent ?</p>
<p>mfg<br />
RB</p>
]]></description><link>https://www.c-plusplus.net/forum/post/500632</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/500632</guid><dc:creator><![CDATA[RED-BARON]]></dc:creator><pubDate>Tue, 13 Apr 2004 15:11:40 GMT</pubDate></item><item><title><![CDATA[Reply to eigenes control mouse-events on Tue, 13 Apr 2004 15:36:34 GMT]]></title><description><![CDATA[<p><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="🙄"
    /><br />
'türlich net, das würd ja einiges erklären ...<br />
das ist</p>
<pre><code class="language-cpp">static LRESULT wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
</code></pre>
<p>von der classe die das control verwaltet<br />
einen zeiger auf das parent hab ich nirgendwo, nur das HWND</p>
]]></description><link>https://www.c-plusplus.net/forum/post/500651</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/500651</guid><dc:creator><![CDATA[DEvent]]></dc:creator><pubDate>Tue, 13 Apr 2004 15:36:34 GMT</pubDate></item><item><title><![CDATA[Reply to eigenes control mouse-events on Tue, 13 Apr 2004 15:57:10 GMT]]></title><description><![CDATA[<p>moin meister ...</p>
<p>aber WM_LBUTTONDOWN kommt im Control an ?</p>
<p>mfg<br />
RB</p>
]]></description><link>https://www.c-plusplus.net/forum/post/500667</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/500667</guid><dc:creator><![CDATA[RED-BARON]]></dc:creator><pubDate>Tue, 13 Apr 2004 15:57:10 GMT</pubDate></item><item><title><![CDATA[Reply to eigenes control mouse-events on Tue, 13 Apr 2004 16:01:38 GMT]]></title><description><![CDATA[<p>moment</p>
<p>WM_MOUSEMOVE<br />
The WM_MOUSEMOVE message is posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window that contains the cursor. Otherwise, the message is posted to the window that has captured the mouse.</p>
<p>habe schnell mal ein Schnipsel geschnipselt<br />
Code im Control:</p>
<pre><code class="language-cpp">case WM_LBUTTONDOWN:
     	pt.x = LOWORD(lp);
   		pt.y = HIWORD(lp) ;
   		SetCapture(hwnd) ;
   		if(PtInRect(&amp;lpMBUTTON-&gt;aRect, pt) == TRUE)
   			lpMBUTTON-&gt;dwButtonState = MBS_DEFAULT;
	    else if(PtInRect(&amp;lpMBUTTON-&gt;bRect, pt) == TRUE)
	    	lpMBUTTON-&gt;dwButtonState = MBS_SIDE;
	    else
     	{
      		ReleaseCapture(); 
        	lpMBUTTON-&gt;dwButtonState = MBS_NORMAL;
      		lpMBUTTON-&gt;dwMovingState = 0;
   		}
      	lpMBUTTON-&gt;dwMovingState = lpMBUTTON-&gt;dwButtonState;
      	RedrawWindow(hwnd,NULL,NULL, RDW_UPDATENOW|RDW_INVALIDATE); 		// Force a Repaint ofthe control
     	break ;
</code></pre>
<p>evtl hilft das ja</p>
<p>mfg<br />
RB</p>
]]></description><link>https://www.c-plusplus.net/forum/post/500672</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/500672</guid><dc:creator><![CDATA[RED-BARON]]></dc:creator><pubDate>Tue, 13 Apr 2004 16:01:38 GMT</pubDate></item><item><title><![CDATA[Reply to eigenes control mouse-events on Tue, 13 Apr 2004 22:33:18 GMT]]></title><description><![CDATA[<p>danke<br />
aber das problem ist ja das überhaupt keine mouse ereignisse an mein control kommen, die werden alle von dem parent-wnd abgefangen.<br />
ich hab das grad mitn einem edit-control versucht, da wird die WM_MOUSELBUTTONDOWN hingeschickt ( an das edit-control nicht an seinen parent-wnd).<br />
das versteh ich eben nicht, an vordefinierten controls wird das geschickt, aber an meinen eigenen nicht.<br />
ich erstell das control-wnd doch ganz normal mit den styles<br />
WS_TABSTOP | WS_CHILD | WS_VISIBLE und RegisterClass mit den styles halt: CS_HREDRAW | CS_VREDRAW | CS_OWNDC<br />
eine WM_PAINT botschaft wird ja hingeschickt<br />
muss ich da irgendwas setzen das es mouse-events bekommt ?<br />
mein control verhält sich ja fast wie ein static-control ... achja und bevor die frage kommt, wc.lpszClassName ist nicht &quot;STATIC&quot;, das ist &quot;COLOREDIT&quot; also ein name der in der SDK nicht vorkommt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/500952</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/500952</guid><dc:creator><![CDATA[DEvent]]></dc:creator><pubDate>Tue, 13 Apr 2004 22:33:18 GMT</pubDate></item><item><title><![CDATA[Reply to eigenes control mouse-events on Tue, 13 Apr 2004 22:35:06 GMT]]></title><description><![CDATA[<p>mach ein kleines, minimales und compilierbares beispiel fertig und wir helfen dir.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/500953</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/500953</guid><dc:creator><![CDATA[hilfe!]]></dc:creator><pubDate>Tue, 13 Apr 2004 22:35:06 GMT</pubDate></item><item><title><![CDATA[Reply to eigenes control mouse-events on Wed, 14 Apr 2004 01:02:59 GMT]]></title><description><![CDATA[<p>ok<br />
danke für die hilfe aber ich habs inzwischen<br />
ich hab die falsche messageProc aufrufen lassen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /><br />
war versehentlich</p>
]]></description><link>https://www.c-plusplus.net/forum/post/500991</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/500991</guid><dc:creator><![CDATA[DEvent]]></dc:creator><pubDate>Wed, 14 Apr 2004 01:02:59 GMT</pubDate></item><item><title><![CDATA[Reply to eigenes control mouse-events on Wed, 14 Apr 2004 07:02:28 GMT]]></title><description><![CDATA[<p>moin meister ...</p>
<p>das hatte ich doch versehentlich schon oben angemerkt <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>
<p>aber ich wundere mich auch immer wieder warum die if Bedingung nicht ausgeführt wird</p>
<p>if(blabla);<br />
blabla = !blabla;<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
<p>mfg<br />
RB</p>
]]></description><link>https://www.c-plusplus.net/forum/post/501046</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/501046</guid><dc:creator><![CDATA[RED-BARON]]></dc:creator><pubDate>Wed, 14 Apr 2004 07:02:28 GMT</pubDate></item></channel></rss>