CitrixMouseButtonUp Function

Action

Moves the mouse to a specified position and releases a button that was pressed by a prior CitrixMouseButtonDown call. If the specified button has not been pressed, an error will be raised. Key modifiers (such as Ctrl and Alt) can be provided. Mouse speed can be specified by profile settings (Citrix / Simulation / Mouse) or an appropriate call to the CitrixSetOption function. The position can be specified absolutely, relative to a window (by providing a window handle) or relative to the last mouse position (by setting the bRelative parameter to true).

The top left corner (of the screen or window) has the coordinates 0 / 0.

Include file

CitrixAPI.bdh

Syntax

CitrixMouseButtonUp( in nX        : number,
                     in nY        : number,
                     in bRelative : boolean optional, 
                     in nWindow   : number optional,
                     in nButton   : number optional,
                     in nModifier : number optional ) : boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
nX X coordinate of the new mouse position (relative to the provided window or the entire desktop). When the bRelative parameter is set to true, the new mouse position is calculated by adding the specified X value to the current mouse position.
nY Y coordinate of the new mouse position (relative to the provided window or the entire desktop). When the bRelative parameter is set to true, the new mouse position is calculated by adding the specified Y value to the current mouse position.
bRelative Specify this parameter to calculate the new mouse position by adding the provided vector (nX, nY) to the current mouse position (optional). When this parameter is omitted, the nWindow parameter dictates how the new mouse position is calculated.
nWindow Window handle returned by a call to CitrixWaitForWindowCreation (optional). When this parameter is omitted or DESKTOP is specified, the provided coordinates must be relative to the desktop. When a window handle is specified, the nX and nY parameters state a position relative to the top left corner of the window (wherever the window is on the desktop).

When the bRelative parameter is set to true, this parameter is ignored.

nButton

Specify one of the following values (optional):

  • MOUSE_ButtonLeft (default): Left mouse button

  • MOUSE_ButtonRight: Right mouse button

  • MOUSE_ButtonMiddle: Middle mouse button

nModifier

Specify one of the following values (optional):

  • MOD_None (default): No modifier

  • MOD_Shift: Shift key pressed in combination with the mouse button

  • MOD_Ctrl: Ctrl key pressed in combination with the mouse button

  • MOD_Alt: Alt key pressed in combination with the mouse button

Example:

transaction TMain
  var
  begin
    CitrixInit(640, 480);
    CitrixConnect("myserver", "myusername", "mypass", "mydomain", COLOR_16bit);
    CitrixWaitForLogon();
    hWnd6 := CitrixWaitForWindowCreation("ICA Seamless Host Agent", MATCH_Exact, 0x94C800C4, 0, 0, 390, 223);
    CitrixWaitForWindow(hWnd6, EVENT_Activate);
    CitrixWaitForWindowCreation("Program Manager");
    CitrixMouseClick(211, 197, hWnd6, MOUSE_ButtonLeft);
    CitrixWaitForWindow(hWnd6, EVENT_Destroy);
    CitrixMouseDblClick(41, 23, DESKTOP, MOUSE_ButtonLeft);
    hWnd8 := CitrixWaitForWindowCreation("My Documents", MATCH_Exact, 0x16CF0000, 171, 98, 328, 235);
    CitrixWaitForWindow(hWnd8, EVENT_Activate);
    CitrixMouseButtonDown(82, 13, hWnd8, MOUSE_ButtonLeft);
    CitrixMouseButtonUp(367, 44, false, DESKTOP, MOUSE_ButtonLeft);
    CitrixWaitForWindowPos(hWnd8, 285, 31);
    ThinkTime(5.41);
    CitrixMouseClick(317, 13, hWnd8, MOUSE_ButtonLeft);
    CitrixWaitForWindow(hWnd8, EVENT_Destroy);
    CitrixDisconnect();
  end TMain;