CitrixGetScreenHash Function

Action

Retrieves the hash value of the selected screen.

The screen region can be specified absolutely or relatively to a window (by specifying a window handle). When a window handle is provided without position or size, the region specified by the window outline is used.

注: CitrixGetScreenHash can only be called in Normal Mode (see CitrixInit). If used in Fast Mode, an error will be raised.

Include file

CitrixAPI.bdh

Syntax

CitrixGetScreenHash( out sHash   : string,
                     in  nWindow : number optional,
                     in  nX      : number optional,
                     in  nY      : number optional,
                     in  nWidth  : number optional,
                     in  nHeight : number optional ) : boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
sHash Hash value of the selected screen region.
nWindow Window handle returned by a call to CitrixWaitForWindowCreation. Use DESKTOP or omit this parameter to specify a region relative to the desktop (or the entire desktop).
nX X coordinate of the left margin of the screen region (optional).
nY Y coordinate of the top margin of the screen region (optional).
nWidth Width of the region (optional). Omit this parameter to get a screenshot of the entire window.
nHeight Height of the region (optional). Omit this parameter to get a screenshot of the entire window.

Example:

  transaction TMain
  var
    sHash : string;
  begin
    CitrixInit(640, 480);
    CitrixConnect("citserver", "user", "password", "companydomain", COLOR_16bit);
    CitrixWaitForLogon();
    hWnd6 := CitrixWaitForWindowCreation("ICA Seamless Host Agent", MATCH_Exact, 0x94C800C4, 0, 0, 390, 223);
    CitrixWaitForWindow(hWnd6, EVENT_Activate);
    CitrixWaitForWindowCreation("Program Manager");
    ThinkTime(3.31);
    CitrixMouseClick(214, 197, hWnd6, MOUSE_ButtonLeft);
    CitrixWaitForWindow(hWnd6, EVENT_Destroy);
    CitrixMouseDblClick(112, 16, DESKTOP, MOUSE_ButtonLeft);
    hWnd9 := CitrixWaitForWindowCreation("Microsoft Excel - Book*", MATCH_Wildcard, 0x15CF0000, -4, -4, 648, 460);
    CitrixGetScreenHash(sHash, hWnd9, 10, 20, 100, 100);
    print(sHash);
    CitrixMouseClick(634, 9, hWnd9, MOUSE_ButtonLeft);
    CitrixWaitForWindow(hWnd9, EVENT_Destroy);
    ThinkTime(3.02);
    CitrixDisconnect();
  end TMain;