NicoVB Posted April 5, 2003 Posted April 5, 2003 How do you simulate a mouse click on a specific coordinate??? Nico Quote Visit http://www.nico.gotdns.com Now ONLINE!
*Gurus* divil Posted April 5, 2003 *Gurus* Posted April 5, 2003 Check out the mouse_event API. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
NicoVB Posted April 6, 2003 Author Posted April 6, 2003 This is what I found: 'Before you start this program, I suggest you save everything that wasn't saved yet. Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long) Const MOUSEEVENTF_LEFTDOWN = &H2 Const MOUSEEVENTF_LEFTUP = &H4 Const MOUSEEVENTF_MIDDLEDOWN = &H20 Const MOUSEEVENTF_MIDDLEUP = &H40 Const MOUSEEVENTF_MOVE = &H1 Const MOUSEEVENTF_ABSOLUTE = &H8000 Const MOUSEEVENTF_RIGHTDOWN = &H8 Const MOUSEEVENTF_RIGHTUP = &H10 Private Sub Form_Activate() 'KPD-Team 1998 'URL: [url]http://www.allapi.net/[/url] 'E-Mail: [email]KPDTeam@Allapi.net[/email] Do 'Simulate a mouseclick on the cursor's position mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0&, 0&, cButt, dwEI DoEvents Loop End Sub Quote Visit http://www.nico.gotdns.com Now ONLINE!
NicoVB Posted April 6, 2003 Author Posted April 6, 2003 What do I have to do if I want to put this code in to .NET???? Quote Visit http://www.nico.gotdns.com Now ONLINE!
Guest mutant Posted April 6, 2003 Posted April 6, 2003 Same thing, I dont believe, mouse_event was poerted to .NET yet. Quote
NicoVB Posted April 6, 2003 Author Posted April 6, 2003 Can you change to code (types of variables) to .NET correct language? The DECLARE statement, can you set it on another way... I remember I saw it otherwise. Quote Visit http://www.nico.gotdns.com Now ONLINE!
Guest mutant Posted April 6, 2003 Posted April 6, 2003 I dont think there there is a correct .NET way because mouse_event hasnt been not made a framework part yet. But from what I know, VB6's long is the same lenght as VB.NET Interger so change the Longs in declarations to Integers. Quote
wyrd Posted April 6, 2003 Posted April 6, 2003 You can use the DllImport() attribute.. somethin like this; <DllImport("user32")> _ Sub mouse_event (ByVal dwFlags As Integer, _ ByVal dx As Integer, _ ByVal dy As Integer, _ ByVal cButtons As Integer, _ ByVal dwExtraInfo As Integer) ' End Sub Hope that works. mutant: It's a windows API function, which means you can use it in any language as it's part of windows itself. Quote Gamer extraordinaire. Programmer wannabe.
Guest mutant Posted April 6, 2003 Posted April 6, 2003 lol... you think I didnt know? Of course I know, but you know how the API functions are ported to .NET class libraries? I was talking about that Quote
wyrd Posted April 6, 2003 Posted April 6, 2003 lol... you think I didnt know? Of course I know, but you know how the API functions are ported to .NET class libraries? I was talking about that *shrug* Sorry. It didn't sound like you knew from the replies you were giving... I dont think there there is a correct .NET way because mouse_event hasnt been not made a framework part yet. But from what I know, VB6's long is the same lenght as VB.NET Interger so change the Longs in declarations to Integers. Just trying to help. :p Quote Gamer extraordinaire. Programmer wannabe.
Guest mutant Posted April 6, 2003 Posted April 6, 2003 My style of writing is weird sometimes, wrong words can be picked for some things :) Quote
NicoVB Posted April 7, 2003 Author Posted April 7, 2003 Thanks guys, just what I wanted to know!!! ;) Quote Visit http://www.nico.gotdns.com Now ONLINE!
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.