Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

Is there an alternative to the SilkTest method DoubleClick()?

Is there an alternative to the SilkTest method DoubleClick()?

Using the MouseEvent Function from within the windows API it is possible to send the appropriate signals to manipulate the mouse as required. e.g.

[-] dll "user32.dll"
[ ]
[ ] mouse_event (long dwFlags ,long dx,long dy,long cButtons,long dwExtraInfo)
[ ]
[ ]
[-] testDblClick()
[ ]
[ ] const MOUSEEVENTF_ABSOLUTE = 32768
[ ] const MOUSEEVENTF_LEFTDOWN = 2
[ ] const MOUSEEVENTF_LEFTUP = 4
[ ] const MOUSEEVENTF_MIDDLEDOWN = 14
[ ] const MOUSEEVENTF_MIDDLEUP = 64
[ ] const MOUSEEVENTF_MOVE = 1
[ ] const MOUSEEVENTF_RIGHTDOWN = 8
[ ] const MOUSEEVENTF_RIGHTUP = 16
[ ]
[ ]
[ ] mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
[ ] mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
[ ] mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
[ ] mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
[ ]

When Called the testDblClick() function will carry out a doubleclick of the Left mouse button on whatever part of the screen the mouse is sitting. Using this in conjuction with MoveMouse or SetPosition should should allow you to manipulate the mouse whichever way you wish.

BACKGROUND
--------------------------------

On occasion the SilkTest method DoubleClick() sometimes does not work. This usually happens when the application opens a dialog on the first click and carries out another function with the second click. The SilkTest doubleclick() method can be too fast.

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 19:32
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.