TN AppSvr207 How to capture the mouse cursor from within an ArchestrA graphic
Last updated: March 9th, 2025Description
- Author: Joe Hefner
- Published: March 9th, 2025
Details:
Description
This article from InSource shows how to capture the mouse cursor from within an ArchestrA graphic using Wonderware Application Server.
- Author: Joseph Hefner
- Published: 7/26/2016
- Applies to: Application Server 2014 R2 or later.
Details
Step 1: Import the System.Windows.Forms dll by going to Galaxy \ Import \ Script Function Library and choosing the dll from the following location:
C:\Windows\Microsoft.NET\Framework\v4.0.30319
Step 2: Create custom properties to hold the cursor values. In this example, they are called XPos and YPos.
Step 3: Create a graphic to display the values and link them to the custom properties:
Step 4: Right click a blank space in the graphic and choose "Scripts" and add the script below to assign the cursor values to the customer property:
XPos = System.Windows.Forms.Cursor.Position.X;
YPos = System.Windows.Forms.Cursor.Position.Y;