IMPORTANT NOTICE: As of 21 February, anything posted in this community WILL NOT BE MIGRATED to our new community site. We have pulled all user information and data from this site and are now in an approximately week long process of importing users, roles, and data to our new site. We are leaving this site open and active so you can post and hopefully get a response until the migration is complete. Once complete, the URL that currently takes you to this site will take you to our new site so your bookmarks will work as always. Please read the information on a New Login Process
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) [ ]