Click to See Complete Forum and Search --> : Mouse Click


August 22nd, 1999, 08:02 AM
sir
Can we activate a window message artificialy e.g mouse click
Niaz

Jan Businger
August 23rd, 1999, 01:45 AM
Hi,

What do you want exactly?
Do you want to have a message come up after you clicked e.g. a form window in VB?

A simple reply would be

Private Sub Form_Click()
MsgBox "Text........"
End Sub

Otherwise provide more details.

Jan

Ravi Kiran
August 27th, 1999, 01:44 AM
Yes. You can synthesise a mouse or keyboard event with mouse_event and keybd_event. But this works on WinNt only. and also MSDN says oflate you should use SendInput APi. NT-specific.

In vb, if you just want to do what you do on a event, mouse click - for example, you can call that function directly in code.
Private sub Form_Click()
... some things happens here
end sub
You want the same thing to happen even if a btn is clicked, say, then
Private sub Command1_Click()
call Form_Click()
end sub
Check if this kind of thing is sufficient for your case.

RK