On Mon, 05 Sep 2011 23:10:05 +0300, Andrej Mitrovic <andrej.mitrov...@gmail.com> wrote:

This is breaking my neck right now. I have two separate windows,
window #2 hides and then shows window #1 whenever it detects the mouse
has moved in window #2. So, if the mouse stops moving, it should stop
doing that.


diff --git a/raw.d b/raw.d
index 6ce0256..8ea7c7c 100644
--- a/raw.d
+++ b/raw.d
@@ -114,10 +114,15 @@ LRESULT WndProc2(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
     switch (message)
     {
         case WM_MOUSEMOVE:
-            static ulong count;
-            writeln(count++);
-            ShowWindow(hWindow1, SW_HIDE);
-            ShowWindow(hWindow1, SW_SHOW);
+            static LPARAM oldPosition;
+            if (lParam != oldPosition)
+            {
+                static ulong count;
+                writeln(count++);
+                ShowWindow(hWindow1, SW_HIDE);
+                ShowWindow(hWindow1, SW_SHOW);
+                oldPosition = lParam;
+            }
             return 0;

         case WM_DESTROY:


I wouldn't think too much about it, the Windows GUI does a lot of weird things for the sake of compatibility etc.

--
Best regards,
 Vladimir                            mailto:vladi...@thecybershadow.net

Reply via email to