|
-
Sep 2nd, 2005, 09:39 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Mouse Click using vb.net
Hello..
Can someone tell me how can I trigger mouse click event whenever I want at any position on the screen where the mouse pointer is?
Thanks
Godwin
Help someone else with what someone helped you! 
-
Sep 2nd, 2005, 10:06 AM
#2
Fanatic Member
Re: Mouse Click using vb.net
On the sceen or on your app's window?
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Sep 2nd, 2005, 11:56 AM
#3
Thread Starter
Fanatic Member
Re: Mouse Click using vb.net
Not on my apps window...On screeen...anywhere on the screen ...startmenu anywhere (that includes apps window too)
Godwin
Help someone else with what someone helped you! 
-
Sep 2nd, 2005, 06:13 PM
#4
Re: Mouse Click using vb.net
You just use the Shared Cursor.Position property.
-
Sep 2nd, 2005, 06:36 PM
#5
Re: Mouse Click using vb.net
from all api
Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
change long to integer, and look it up online for examples
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Sep 2nd, 2005, 06:40 PM
#6
Re: Mouse Click using vb.net
 Originally Posted by jmcilhinney
You just use the Shared Cursor.Position property.
Forget I said that. D*mn, must read questions properly before posting.
-
Sep 2nd, 2005, 06:41 PM
#7
Re: Mouse Click using vb.net
 Originally Posted by jmcilhinney
Forget I said that. D*mn, must read questions properly before posting. 
I do that all the time
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Sep 2nd, 2005, 10:17 PM
#8
Thread Starter
Fanatic Member
Re: Mouse Click using vb.net
ok,how do I change this c# statement into vb.net?
Code:
public enum MouseEventFlags
{
LEFTDOWNE = 0x00000002,
LEFTUP = 0x00000004,
MIDDLEDOWN = 0x00000020,
MIDDLEUP = 0x00000040,
MOVE = 0x00000001,
ABSOLUTE = 0x00008000,
RIGHTDOWN = 0x00000008,
RIGHTUP = 0x00000010
}
It gives me an error if I simply put it like
VB Code:
Public Enum MouseEventFlags
LEFTDOWNE = (0x00000002)
LEFTUP = 0x00000004
MIDDLEDOWN = 0x00000020
MIDDLEUP = 0x00000040
MOVE = 0x00000001
ABSOLUTE = 0x00008000
RIGHTDOWN = 0x00000008
RIGHTUP = 0x00000010
End Enum
I have the c# code sample for that API...im trying to convert it to vb.net..and this enum also is used there for it
Godwin
Help someone else with what someone helped you! 
-
Sep 2nd, 2005, 10:19 PM
#9
Thread Starter
Fanatic Member
Re: Mouse Click using vb.net
vb.net says it expects end of statement..Thats the error its giving for that enum..What should I do?
Godwin
Help someone else with what someone helped you! 
-
Sep 2nd, 2005, 10:21 PM
#10
Thread Starter
Fanatic Member
Re: Mouse Click using vb.net
oops,I guess u told me to look at allapi.net...i was wondering what u meant by "from all api" first.
now i got it...Ill check there now..I saw this from pinvoke.net
Godwin
Help someone else with what someone helped you! 
-
Sep 2nd, 2005, 10:43 PM
#11
Thread Starter
Fanatic Member
-
Sep 2nd, 2005, 10:57 PM
#12
Thread Starter
Fanatic Member
Re: Mouse Click using vb.net
Hello people...
here is an example...Hope it helps someone 
VB Code:
Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)
Private Const MOUSEEVENTF_ABSOLUTE = &H8000 ' absolute move
Private Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down
Private Const MOUSEEVENTF_LEFTUP = &H4 ' left button up
Private Const MOUSEEVENTF_MOVE = &H1 ' mouse move
Private Const MOUSEEVENTF_MIDDLEDOWN = &H20
Private Const MOUSEEVENTF_MIDDLEUP = &H40
Private Const MOUSEEVENTF_RIGHTDOWN = &H8
Private Const MOUSEEVENTF_RIGHTUP = &H10
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 1)
End Sub
Ive set a timer to keep the mousedown...
but now,Im in need of something else too...capturing the mouse event apart from clicking it...fine,Ill start a new thread for that...I wonder if theres a way to do that without APIs
Godwin
Help someone else with what someone helped you! 
-
Sep 3rd, 2005, 11:49 PM
#13
Re: [RESOLVED] Mouse Click using vb.net
nicely done
remove the extra constants though lol, they don;t seem to be used
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Sep 3rd, 2005, 11:53 PM
#14
Re: [RESOLVED] Mouse Click using vb.net
umm I'm looking at this page about this on MSDN,
http://msdn.microsoft.com/library/de...ouse_event.asp
it says This function has been superseded. Use SendInput instead.
I don't know what, if any, problems might occur if you stick with this function, but apparently using SendInput is the more correct way
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Sep 4th, 2005, 12:42 AM
#15
New Member
Re: [RESOLVED] Mouse Click using vb.net
but,this mouse event function works so perrrfecttt..theres no problem at all...but,very easy to make an annoying autoclick program with it by putting it in a timer.. maybe thats why they brought something better...i dont know,but this one works soo perfect and mouse buttons left right and middle can all be controlled smoothly including all their events up,down,etc.I think sendkeys doesnt have so much control over the mouse
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|