Hello,
Recompiled some code with 9, and now it doesn't work completely. Basically, the problem is I had a graphics window that one could click in, and the mouse position would be reported. It's not doing that anymore. As you can see below, I've included the subclass function, how I subclass the graphics window, and the two functions that are called when the left or right mouse buttons are pressed. Any thoughts on why all this worked in 8 and not 9?
-CMR
Recompiled some code with 9, and now it doesn't work completely. Basically, the problem is I had a graphics window that one could click in, and the mouse position would be reported. It's not doing that anymore. As you can see below, I've included the subclass function, how I subclass the graphics window, and the two functions that are called when the left or right mouse buttons are pressed. Any thoughts on why all this worked in 8 and not 9?
-CMR
Code:
'here's my subclass function FUNCTION SubClassProc(BYVAL hWnd AS LONG, BYVAL wMsg AS LONG, BYVAL wParam AS LONG, BYVAL lParam AS LONG) AS LONG 'process our messages in this subclass procedure SELECT CASE wMsg CASE %WM_LBUTTONDOWN CALL POILeft(hWnd) CASE %WM_RBUTTONDOWN CALL POIRight(hWnd) END SELECT 'pass the message on to the original window procedure...the DDT engine! FUNCTION = CallWindowProc(gOldSubClassProc, hWnd, wMsg, wParam, lParam) END FUNCTION 'here's how I subclass the graphics window so it can intercept mouse messages gOldSubClassProc = SetWindowLong(hGFX, %GWL_WNDPROC, CODEPTR(SubClassProc)) 'here's a function to report the point of interest FUNCTION POIleft(BYVAL hWnd AS LONG) AS LONG DIM title AS STRING 'see where the mouse is now GetCursorPos patch1.origin 'and return its pozLeft in terms of the graphic window's client area ScreenToClient(hWnd, patch1.origin) DIALOG GET TEXT hWnd TO title DIALOG SET TEXT hWnd, "AVI "+FORMAT$(patch1.origin.x,"000") + ", " + FORMAT$(patch1.origin.y,"000")+";"+REMAIN$(title, ";") END FUNCTION 'another function to report the point of interest FUNCTION POIright(BYVAL hWnd AS LONG) AS LONG DIM title AS STRING 'see where the mouse is now GetCursorPos patch2.origin 'and return its pozLeft in terms of the graphic window's client area ScreenToClient(hWnd, patch2.origin) DIALOG GET TEXT hWnd TO title DIALOG SET TEXT hWnd, EXTRACT$(title,";")+";"+FORMAT$(patch2.origin.x,"000") + ", " + FORMAT$(patch2.origin.y,"000") END FUNCTION
Comment