{{tag>category:"OpenInsight 32-bit Specific"}}
[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]]
==== 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_Struct
DECLARE FUNCTION Struct_To_Var
XY=STR(\00\, 4)
GetCursorPos(XY)
XY=Struct_To_Var(XY, "POINT")
X =XY
Y =XY
returns 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=XY
[url=http://www.sprezzatura.com]The Sprezzatura Group[/url]
[i]World leaders in all things RevSoft[/i]
[img]http://www.sprezzatura.com/zz.gif[/img]
----
=== At 27 MAY 2006 10:43AM George Farrugia wrote: ===
Once again, thanks a lot Sprezz. You make it look so easy :)
[[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=8C7624358E432C978525717B002B4D8A|View this thread on the forum...]]