From: Shawn Fessenden [shawn@testech-ltd.com]
Sent: Friday, October 31, 2003 2:43 AM
To: VEE vrf
Subject: [vrf] RE: simulate Mouse click

> Is ist possible so simulate programaticaly the cklick of the left mouse?

Yes M'am. The difficulty is in finding the destination window the click
should be sent to. It's much less verbose in C:

VOID LeftClick(hWnd)
{
// Use array of 4 Int32 in VEE, left = [0], top = [1], right = [2], bottom = [3].
RECT	rc;

// Use array of 2 Int32 in VEE, x = [0], y = [2].
POINT	pt;

  // We'll need a phoney cursor location.
  GetClientRect(hWnd, &rc); //User32.dll
  pt.x = rc.right - ((rc.right - rc.left) / 2);
  pt.y = rc.bottom - ((rc.bottom - rc.top) / 2);

  // Post l-button down and up messages.
  //                 0x0201                              LSW   MSW
  PostMessage(hWnd, WM_LBUTTONDOWN, 0,          MAKELONG(pt.x, pt.y));
//User32.dll
  PostMessage(hWnd, WM_LBUTTONUP,   MK_LBUTTON, MAKELONG(pt.x, pt.y));
  //                 0x0202          0x0001
}

The hard part is figuring out the window handle. This clicks the left button
once at the center of the target window. If you're clicking a VEE 5.x
Confirmation button, I have a way to find the hWnd of the button. Other VEE
objects are more tricky.

There are other ways to do this that are more "correct", depending on your
circumstances. Specifically, the Win32 function SendInput supercedes all
previous methods of simulating input events to various windows.
-SHAWN-


From: B Aufenanger [aufenanger@somatec.de]
Sent: Thursday, October 30, 2003 9:43 AM
To: VEE vrf
Subject: [vrf] simulate Mouse click

Is ist possible so simulate programaticaly the cklick of the left mouse?

Best regards

B. Aufenanger

------------------------------------------------------------

Somatec B. Aufenanger & M. Bernhardt
Jagdweg 7a
D-82041 Deisenhofen

Telefon             : (089) 613 984 91
Fax.                 : (089) 613 981 23
Email                : mailto:Aufenanger@somatec.de
homepage        : http://www.somatec.com/

------------------------------------------------------------
