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

Can I use SilkTest to launch an application by clicking a button on another application?

Can I use SilkTest to launch an application by clicking a button on another application?

Clicking a button on an application to launch another application can have the effect of hanging the entire machine and leaving the mouse and keyboard unresponsive.

The problem can be overcome by using the following declaration to create a new method for the PushButton class. This method is based on sending events to the mouse controller and will not hang when used to invoke another application.

[ ]
[-] dll "user32.dll"
      [ ] mouse_event (long dwFlags ,long dx,long dy,long cButtons,long dwExtraInfo)
[ ]
[ ]
[ ]
[ ]
[-] winclass PushButton : AnyWin
      [ ]
      [ ] // New click method
     [-] NewClick()
          [ ]
          [ ] // various Constants to manipulate different buttons on mouse
          [ ]
          [ ] const MOUSEEVENTF_LEFTDOWN = 2
          [ ] const MOUSEEVENTF_ABSOLUTE = 32768
          [ ] const MOUSEEVENTF_LEFTUP = 4
          [ ] const MOUSEEVENTF_MIDDLEDOWN = 14
          [ ] const MOUSEEVENTF_MIDDLEUP = 64
          [ ] const MOUSEEVENTF_MOVE = 1
          [ ] const MOUSEEVENTF_RIGHTDOWN = 8
          [ ] const MOUSEEVENTF_RIGHTUP = 16
          [ ]
          [ ] // Move Mouse Pointer over current object
          [ ] this.MoveMouse()
          [ ]
          [ ] //Send message to mouse controller to press and release mouse at current position
          [ ]
          [ ] mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
          [ ] mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
          [ ]

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.