changeset 75:d5928da5a1f0

Change from using GetCursorPos() to GetMessagePos() in a couple places.
author Jordan Miner <jminer7@gmail.com>
date Wed, 12 Aug 2009 05:44:50 -0500
parents 7adc733aca2d
children 76b081749316
files dynamin/c/windows.d dynamin/gui/windows_window.d
diffstat 2 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/dynamin/c/windows.d	Wed Aug 12 05:16:30 2009 -0500
+++ b/dynamin/c/windows.d	Wed Aug 12 05:44:50 2009 -0500
@@ -833,6 +833,8 @@
 HCURSOR SetCursor(HCURSOR hCursor);
 
 BOOL GetCursorPos(POINT* lpPoint);
+
+DWORD GetMessagePos();
 //}}}
 
 //{{{ keyboard functions
--- a/dynamin/gui/windows_window.d	Wed Aug 12 05:16:30 2009 -0500
+++ b/dynamin/gui/windows_window.d	Wed Aug 12 05:44:50 2009 -0500
@@ -573,12 +573,13 @@
 	switch(uMsg) {
 	case WM_ENTERSIZEMOVE: //when the user starts moving or resizing the window
 		//{{{
-		POINT cursor;
-		GetCursorPos(&cursor);
+		DWORD cur = GetMessagePos();
+		short curX = cur & 0xFFFF;
+		short curY = cur >> 16;
 		RECT rect;
 		GetWindowRect(hwnd, &rect);
-		dragX = cursor.x-rect.left;
-		dragY = cursor.y-rect.top;
+		dragX = curX-rect.left;
+		dragY = curY-rect.top;
 		return 0;
 		//}}}
 	case WM_MOVING:
@@ -588,10 +589,11 @@
 		RECT* rect = cast(RECT*)lParam;
 		int rectWidth = rect.right-rect.left;
 		int rectHeight = rect.bottom-rect.top;
-		POINT cursor;
-		GetCursorPos(&cursor);
-		rect.left = cursor.x-dragX;
-		rect.top = cursor.y-dragY;
+		DWORD cur = GetMessagePos();
+		short curX = cur & 0xFFFF;
+		short curY = cur >> 16;
+		rect.left = curX-dragX;
+		rect.top = curY-dragY;
 		void updateRightAndBottom() {
 			rect.right = rect.left+rectWidth;
 			rect.bottom = rect.top+rectHeight;