<?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[TRACKMOUSEEVENT für Fenster+Controls gleichzeitig]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie der Titel schon aussagt, wie kann das Hauptfenster + die darin enthaltenen Controls abfangen, sprich das das für das ganze Fenster gilt, auch wenn ich mit der Maus über einem Control bin (wo nämlich WM_MOUSELEAVE / WM_MOUSEHOVER ans Fenster geworfen werden). Hier mal der Source dazu was ich schon hab:</p>
<pre><code class="language-cpp">case WM_INITDIALOG:
		{

			inWindow = FALSE;
			alpha = 1;

			RECT rect;
			SystemParametersInfo(SPI_GETWORKAREA, 0, &amp;rect, 0);
			MoveWindow(hwnd, rect.right - 200, 0, 200, rect.bottom - rect.top, TRUE);
			hwndLV = CreateWindowEx(NULL, WC_LISTVIEW, &quot;&quot;, WS_CHILD | LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP | WS_VISIBLE, 5, 5, 190, rect.bottom - rect.top - 10, hwnd, (HMENU)100001, GetModuleHandle(NULL), NULL);

			LVCOLUMN lvColumn;
			int col = 0;
			lvColumn.mask = LVCF_TEXT | LVCF_WIDTH;

			lvColumn.cx = 190;
			lvColumn.pszText = &quot;Path&quot;;
			ListView_InsertColumn(hwndLV, col, &amp;lvColumn);

			SetTimer(hwnd, TIMER1, 5, NULL);
			return TRUE;
		}
case WM_MOUSEMOVE:
		{
			if(!inWindow)
			{
				inWindow = TRUE;
				TRACKMOUSEEVENT tme;
				tme.cbSize = sizeof(TRACKMOUSEEVENT);
				tme.dwFlags = TME_HOVER | TME_LEAVE; //&lt;-- gilt ja nur fürs Fenster ohne Controls :(
				tme.hwndTrack = hwnd;
				tme.dwHoverTime = 1;
				TrackMouseEvent(&amp;tme);
				return FALSE;
			}
			return TRUE;
		}
		case WM_MOUSELEAVE:
		{
			if(inWindow)
			{
				inWindow = FALSE;
				KillTimer(hwnd, TIMER1);
				SetTimer(hwnd, TIMER3, 1000, NULL);
				return FALSE;
			}
			return TRUE;
		}
		case WM_MOUSEHOVER:
		{
			if(inWindow)
			{
				inWindow = TRUE;
				KillTimer(hwnd, TIMER2);
				SetTimer(hwnd, TIMER1, 5, NULL);

				RECT rect;
				SystemParametersInfo(SPI_GETWORKAREA, 0, &amp;rect, 0);
				MoveWindow(hwnd, rect.right - 200, 0, 200, rect.bottom - rect.top, TRUE);		
				return FALSE;
			}
			return TRUE;
		}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/185546/trackmouseevent-für-fenster-controls-gleichzeitig</link><generator>RSS for Node</generator><lastBuildDate>Sun, 05 Jul 2026 11:39:56 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/185546.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 26 Jun 2007 18:40:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to TRACKMOUSEEVENT für Fenster+Controls gleichzeitig on Tue, 26 Jun 2007 18:40:49 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie der Titel schon aussagt, wie kann das Hauptfenster + die darin enthaltenen Controls abfangen, sprich das das für das ganze Fenster gilt, auch wenn ich mit der Maus über einem Control bin (wo nämlich WM_MOUSELEAVE / WM_MOUSEHOVER ans Fenster geworfen werden). Hier mal der Source dazu was ich schon hab:</p>
<pre><code class="language-cpp">case WM_INITDIALOG:
		{

			inWindow = FALSE;
			alpha = 1;

			RECT rect;
			SystemParametersInfo(SPI_GETWORKAREA, 0, &amp;rect, 0);
			MoveWindow(hwnd, rect.right - 200, 0, 200, rect.bottom - rect.top, TRUE);
			hwndLV = CreateWindowEx(NULL, WC_LISTVIEW, &quot;&quot;, WS_CHILD | LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP | WS_VISIBLE, 5, 5, 190, rect.bottom - rect.top - 10, hwnd, (HMENU)100001, GetModuleHandle(NULL), NULL);

			LVCOLUMN lvColumn;
			int col = 0;
			lvColumn.mask = LVCF_TEXT | LVCF_WIDTH;

			lvColumn.cx = 190;
			lvColumn.pszText = &quot;Path&quot;;
			ListView_InsertColumn(hwndLV, col, &amp;lvColumn);

			SetTimer(hwnd, TIMER1, 5, NULL);
			return TRUE;
		}
case WM_MOUSEMOVE:
		{
			if(!inWindow)
			{
				inWindow = TRUE;
				TRACKMOUSEEVENT tme;
				tme.cbSize = sizeof(TRACKMOUSEEVENT);
				tme.dwFlags = TME_HOVER | TME_LEAVE; //&lt;-- gilt ja nur fürs Fenster ohne Controls :(
				tme.hwndTrack = hwnd;
				tme.dwHoverTime = 1;
				TrackMouseEvent(&amp;tme);
				return FALSE;
			}
			return TRUE;
		}
		case WM_MOUSELEAVE:
		{
			if(inWindow)
			{
				inWindow = FALSE;
				KillTimer(hwnd, TIMER1);
				SetTimer(hwnd, TIMER3, 1000, NULL);
				return FALSE;
			}
			return TRUE;
		}
		case WM_MOUSEHOVER:
		{
			if(inWindow)
			{
				inWindow = TRUE;
				KillTimer(hwnd, TIMER2);
				SetTimer(hwnd, TIMER1, 5, NULL);

				RECT rect;
				SystemParametersInfo(SPI_GETWORKAREA, 0, &amp;rect, 0);
				MoveWindow(hwnd, rect.right - 200, 0, 200, rect.bottom - rect.top, TRUE);		
				return FALSE;
			}
			return TRUE;
		}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1314259</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1314259</guid><dc:creator><![CDATA[VirtualDreams]]></dc:creator><pubDate>Tue, 26 Jun 2007 18:40:49 GMT</pubDate></item></channel></rss>