Absolute mouse position (OpenInsight 32-bit Specific)
At 27 MAY 2006 03:52:58AM George Farrugia wrote:
In this forum I read somewhere that the following piece of code …
DECLARE SUBROUTINE GetCursorPos, Parse_StructDECLARE FUNCTION Struct_To_VarXY=STR(\00\, 4)GetCursorPos(XY)XY=Struct_To_Var(XY, "POINT")X =XYY =XYreturns the X and Y coordinates.
I'm managing to obtain the X coordinate but the Y coordinate is always null. I then replaced the line containing Struct_To_Var with this one:
Parse_Struct(XY, "POINT", X, Y)but still, I can only get the X coordinate; the Y coordinate is always null. What could I be doing wrong?
At 27 MAY 2006 07:48AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
George,
That looks like 16-bit code. A Win32 POINT is 8 bytes (2 x 4-byte integers), not 4.
First thing - make sure the POINT structure definition is correct. Use the DEFINE_STRUCT window to check that both elements are two signed long integers.
Next use the blank_struct() function to create the memory for the point structure.
DECLARE SUBROUTINE GetCursorPos, Parse_Struct DECLARE FUNCTION Struct_To_Var, blank_Struct XY=blank_struct( "POINT" ) GetCursorPos(XY) XY=Struct_To_Var(XY, "POINT") X=XY Y=XYWorld leaders in all things RevSoft
At 27 MAY 2006 10:43AM George Farrugia wrote:
Once again, thanks a lot Sprezz. You make it look so easy :)