Forum Discussion

tim_faron's avatar
11 years ago

Alternative to Win32API commands in Script Extension

Is there an alternative to using the following code in a script extension: Sys.Desktop.MouseDown(Win32API.VK_LBUTTON, X, Y); Sys.Desktop.MouseUp(Win32API.VK_LBUTTON, X, Y); W...
  • HKosova's avatar
    11 years ago
    Hi Tim,

    The Win32API object isn't available in script extensions, so you need to explicitly define the constant:

    var VK_LBUTTON = 1;


    Sys.Desktop.MouseDown(VK_LBUTTON, X, Y);

    Sys.Desktop.MouseUp(VK_LBUTTON, X, Y);

    You can find the VK_* constant values in this MSDN article:

    Virtual-Key Codes