It's another program, this acts like a remote access app. I have no
problem with the clicks, but adding any modifiers don't do anything.
It must be possible, otherwise how would programs like VNC do it?
On Nov 19, 8:25 am, "Phill W." <
[email protected]>
wrote:
(e-mail address removed) wrote:
I tried this but it doesn't work
keybd_event(VK_CONTROL, 0, 0, 0)
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0)
If it's a control in your own application, use
[<control>].PerformClick()
It has all the same restrictions as clicking it interactively - the
control has to be visible and enabled (as do all of its parent controls).
If it's a /different/ application, are you running Vista?
That puts some fairly rigid barriers between types of application,
preventing them from doing just this sort of thing.
Any idea how to do this?
No, but then I'm not familiar with these particular functions.
Take a step back; what is the end /result/ you're trying to achieve?
HTH,
Phill W.
Hi,
If your VNC program accepts an action with modifier key combination
when it's first activated (got focus), just like on normal usage, you
can automate it using SendKeys.Send method based on that approach:
For example, send a CTRL+UP message
' First activate the VNC application
' You can pass its process ID
' or its title string
AppActivate("Welcome to VNC")
' Send CTRL+UP using CTRL modifier
SendKeys.Send("^{UP}")
...where caret (^) is your modifier, in that case, control key.
For more keys:
http://msdn.microsoft.com/en-us/library/8c6yea83(VS.85).aspx
Hope that approach makes some sense,
Onur Güzel