dcsimg
Results 1 to 12 of 12

Thread: [RESOLVED] VB Virtual Mouse

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    9

    Resolved [RESOLVED] VB Virtual Mouse

    I am working on a my own twitter bot(please don't tell me there 100 out there use another, I wish to make my own). The internet browser is located in the form. I currently use Sendkeys and make the program actually move the mouse to click through the pages, login and copy and paste some info(No not spamming, 1 textbox and it logs in and changes my status on selected accounts which are highlighted in a listbox). Is there a way I can basicly make the form have it's own mouse or simulate fake clicks without the use of my actual cursor possible API? Like its a virtual machine so to say. I want to be able to run the program in the background and still simulate mouse clicks without using my actual cursor. I remember being able to do it a long time ago so I believe it should still be possible. Also I'm not good with Winsock so that won't work cause I need to actually copy paste. Unless you would like to give me a tutorial.

  2. #2

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    9

    Re: VB Virtual Mouse

    I have 10 website and 10 twitter accounts to follow each plus a few for my blogs and then my own to talk about them all.. Instead of most other 'bots' You either have to login 1 by 1 to to change your status (which is faster than manually doing it) Then you have ones that can change status for all 10 but mine I just hold down ctrl and select which accounts I want to update lets say 5 and it just logs into those 5. Which right now it does it all for me..but it uses my actual mouse which is quite annoying.

  4. #4

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    9

    Re: VB Virtual Mouse

    Also working on a forum monitor bot that looks for 'spam' multiple instances of the same post in different areas and links that happen to get past my current setup. It will scan the web broswer field at the area of text for the cursor to change. This is why I talked about the "copy/paste" above. Running so many websites I'd like to have things automated and clean/easy for me as possible.
    Last edited by pdent1; Oct 23rd, 2009 at 02:41 PM.

  5. #5
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284

    Re: VB Virtual Mouse

    Unfortunately Sendkeys() wont work neither on Vista, or Win7, because of security reasons. If you just want to completely drop the 'fake mouse clicks' idea, then you have to use the DOM object provided for the WebBrowser control. You can gain access almost every parts of a website, somewhat the same way the javascript code does.

    Some of your questions regarding this DOM could be already answered here in this thread at the CodeBank, so just take a visit here.
    http://www.vbforums.com/showthread.php?t=384076

  6. #6

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    9

    Re: VB Virtual Mouse

    sorry to say uhh..I'm running vista and currently using sendkeys.. I 'altered' the cody slightly but ya it works fine

  7. #7

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    9

    Re: VB Virtual Mouse

    also I like that page but it specifies how to fill forms which I already use but how would i use this to click buttons or right click at a specific point without untilizing my mouse? I have com/dll's that work if I'm on XP to left/right click or sendkeys a background window but I would like to do this in all VB.

    Reading into page 3 I caught:

    webBrowser1.SetFocus
    If str = 1 Then
    SendKeys "{PGDN}+{PGDN}"

    anyway to point the sendkeys directly at the webbrowser. I have some ideas but most likely they won't work so I figured I'd go ahead and ask.
    Last edited by pdent1; Oct 25th, 2009 at 08:27 PM.

  8. #8
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284

    Re: VB Virtual Mouse

    Just like i told, the easiest way to automatize a webpage without the single touch of the mouse (nor any api call that generates such events) is to use the WebBrowser and its document object.

    Regarding the SendKeys, i didn't read your post carefully.
    The internet browser
    This one is confused me. Actually you are using the WebBrowser control on your form, there SendKeys will work, because it is embeded in your actual application, but you can't send the keystrokes to another application. That would be against the security policies on Vista, and the OS will deny the process.

  9. #9

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    9

    Re: VB Virtual Mouse

    No I can sendkeys anywhere to Internet Explorer and games and such. But yes for this I changed it from internet explorer to a VB dll so I could find a way to avoid API I don't have VB installed (PC crashed and I need to find the disks to reinstall.) Will >
    With WebBrowser1.Document
    SendKeys "Loginname"
    mousemove "100","100"
    End With

    Work without "physically" utilizing my mouse.? or

    Dim lngReturn As Long
    Dim lhwnd As Long
    lhwnd = WebBrowser1.hWnd ' get you web browser handle
    lngReturn = PostMessage(lhwnd, WM_KEYDOWN, vbKey, 0)

    but would like to know what works

  10. #10

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    9

    Re: VB Virtual Mouse

    Thanks I actually figured it out on my own pretty simple.

    My question now is.. Using API is there a way to send a left or right mouse click...Such as PostMessage

    My current code for mouse movement is
    mouse_event MOUSEEVENTF_MOVE, xMove, yMove, 0, 0

    but I need to be able to insert API so it is done without using my cursor still.

  11. #11

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    9

    Re: VB Virtual Mouse

    I mean I need one that uses a HWND variable to direct it to where it needs to go

  12. #12

    Thread Starter
    New Member
    Join Date
    Oct 2009
    Posts
    9

    Re: VB Virtual Mouse

    Thanks for the responses I have actually figured it all out doing it inside of a form and actual Internet explorer. Little bit of research on the RIGHT topic goes a long way I guess. If anyone needs to know how this is done or Sendkeys in Vista or Win7 for that matter. Shoot my a PM and I'll give you hints to how its done that I'm sure you'll figure out

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width