soccer jersey forums.silverfrost.com :: View topic - Replacing GET_MOUSE_POSITION with CLEARWIN_INFO
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Replacing GET_MOUSE_POSITION with CLEARWIN_INFO

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
MJW4498



Joined: 08 Dec 2023
Posts: 6

PostPosted: Tue Feb 13, 2024 10:46 am    Post subject: Replacing GET_MOUSE_POSITION with CLEARWIN_INFO Reply with quote

I'm upgrading a suite of programs from 32-bit to compile in 64-bit.
While in 32-bit, I have been upgrading a call to GET_MOUSE_POSITION (which has not been made available in clearwin64) to CLEARWIN_INFO.
For clarity, I've upgraded the calling routine to call either of the following two routines...
------
Code:
      SUBROUTINE GET_MOUSE_POSITION_OLD (IHOUT7, IVOUT7, IBS7)
C
      USE mswin$
C
      INTEGER(KIND=7) IHOUT7, IVOUT7, IBS7
      INTEGER*2 IHOUT2, IVOUT2, IBS2
C     
      INTEGER(KIND=7) EBS7(1)
      INTEGER*2 EBS2(4)
      EQUIVALENCE (EBS7,EBS2)
C
      CALL GET_MOUSE_POSITION$ (IHOUT2, IVOUT2, IBS2)
      IHOUT7 = IHOUT2
      IVOUT7 = IVOUT2
      EBS7(1) = 0
      EBS2(1) = IBS2
      IBS7 = EBS7(1)
C
      RETURN
C
C     END OF SEGMENT GET_MOUSE_POSITION_OLD
C
      END
C
C
C
      SUBROUTINE GET_MOUSE_POSITION_NEW (IHOUT7, IVOUT7, IBS7)
C
      USE mswin$
C
      INTEGER(KIND=7) IHOUT7, IVOUT7, IBS7
C
      IHOUT7 = CLEARWIN_INFO$ ('GRAPHICS_MOUSE_X')
      IVOUT7 = CLEARWIN_INFO$ ('GRAPHICS_MOUSE_Y')
      IBS7 = CLEARWIN_INFO$ ('GRAPHICS_MOUSE_FLAGS')
C
      RETURN
C
C     END OF SEGMENT GET_MOUSE_POSITION_NEW
C
      END

------
Using the first subroutine (_OLD), the software works fine, with the X,Y and FLAGS operating correctly.

With the second subroutine called (_NEW) it fails with the X,Y,FLAGS all being zero.

Interestingly, if I call the _NEW one immediately after the _OLD one, it returns the SAME values.
Is this because the CLEARWIN_INFO returns the information at the time of the last call back, whereas GET_MOUSE_POSITION is continuous (ie effectively initiates its own call back)?

This bears a large resemblance to the following post by GEWV, Posted: Tue Nov 26, 2013 9:59 am Post subject: get_mouse_position
That post doesn't offer a simple solution, like forcing the CLEARWIN_INFO to refresh which is what I would have hoped for, though PaulLaidler did suggest that get-mouse-position could be considered fo 64-bit. This routine is highly embedded in a whole suite of programs, and doesn't lend itself to a change in structure.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8017
Location: Salford, UK

PostPosted: Tue Feb 13, 2024 11:22 am    Post subject: Reply with quote

get_mouse_position@ is exported by clearwin64.dll and can be accessed using

Code:
INCLUDE <dbos.ins>


or

Code:
      C_EXTERNAL GET_MOUSE_POSITION@ "__get_mouse_position"(REF,REF,REF)
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8017
Location: Salford, UK

PostPosted: Tue Feb 13, 2024 11:39 am    Post subject: Reply with quote

For GRAPHICS_MOUSE_X etc. you will need the option [full_mouse_input] for the related graphics region.
Back to top
View user's profile Send private message AIM Address
DASwainEsq



Joined: 24 Feb 2015
Posts: 4

PostPosted: Wed Feb 14, 2024 9:36 am    Post subject: Reply with quote

Thanks Paul, that appears to work."
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group