Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 05:50

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Vb Mausbewegen Problem "Maus will nicht dahin wo sie soll"

Discussion on Vb Mausbewegen Problem "Maus will nicht dahin wo sie soll" within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2009
Posts: 3,963
Received Thanks: 1,584
Vb Mausbewegen Problem "Maus will nicht dahin wo sie soll"

Hi wenn ich die Coordinaten speicher und die dann benutze dann klappt da was nicht... die geht ncihtd ahin wo sie hin soll hier der code vll findet ihr ja den fehler.. ich meine es liegt an den

Klicky
KlickX
MouseX
MouseY

Das ich da irgendwas falsch speichere... hab schon jezt ne halbe stunden probiert naja viel glück..

Code:
Public Class Form1
    Dim MouseY As String
    Dim MouseX As String
    Dim klicks As String

    Dim klickx As String
    Dim klicky As String

    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkeys As Long) As Integer
    Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Start()
        Timer2.Start()

        klickx = 0
        klicky = 0
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick


        MouseX = MousePosition.X

        MouseY = MousePosition.Y

        Label1.Text = "Derzeitige Mausposition: " + MouseY + " : " + MouseX


    End Sub


    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        Dim hotkey1 As Boolean
        Dim hotkey2 As Boolean
        Dim hotkey3 As Boolean
        'Hotkey1 = Start
        'Hotkey2 = Stop
        'Hotkey3 = Save Koordinaten

        hotkey1 = GetAsyncKeyState(Keys.F11)
        hotkey2 = GetAsyncKeyState(Keys.F12)
        hotkey3 = GetAsyncKeyState(Keys.F10)

        If hotkey1 = True Then
            'Timer3 ist der der klickt...
            Timer3.Interval = Val(TextBox3.Text) * Val("1000")
            Timer3.Start()
            klicks = TextBox2.Text
        End If

        If hotkey2 = True Then
            Timer3.Stop()
        End If

        If hotkey3 = True Then
            TextBox1.Text = MouseY + " , " + MouseX
            klickx = MouseX
            klicky = MouseY
        End If


    End Sub

    Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
        If klicks > 0 Then
            Call SetCursorPos(klicky, klickx)
            mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
            mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
            klicks = Val(klicks) - Val("1")
            TextBox2.Text = klicks

        Else
            Timer3.Stop()
        End If

    End Sub

    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)

    Private Const MOUSEEVENTF_ABSOLUTE = &H8000
    Private Const MOUSEEVENTF_LEFTDOWN = &H2
    Private Const MOUSEEVENTF_LEFTUP = &H4
    Private Const MOUSEEVENTF_MIDDLEDOWN = &H20
    Private Const MOUSEEVENTF_MIDDLEUP = &H40
    Private Const MOUSEEVENTF_MOVE = &H1
    Private Const MOUSEEVENTF_RIGHTDOWN = &H8
    Private Const MOUSEEVENTF_RIGHTUP = &H10


   
End Class
EDIT:

Habs gefunden
Hiermitklappte es
Code:
 Windows.Forms.Cursor.Position = New Point(klickx, klicky)
anstatt mit
Code:
     Call SetCursorPos(klicky, klickx)
Algaten™ is offline  
Reply


Similar Threads Similar Threads
Kann mir bitte jemmand eine Hmachi HP erstellen """""SOS HELP""""
09/15/2010 - Metin2 Private Server - 11 Replies
SO wie der Titel schon sagt ich suche einen der mir per Teamviwer eine hp machen kann habe schon alles ausprobiert aber es klappt nie!!!! PLS HELP...
Warum sind bei Warrock Wörter wie "geh" oder "nicht" zensiert?
05/01/2010 - WarRock - 10 Replies
und z. B. Beleidigungen oder rassistische Aüßerungen nicht ?
Bot sendet "602", soll aber nur "6" senden
12/01/2009 - AutoIt - 8 Replies
Guden, bin grade dabei mir einen kleinen Bot zu basteln, der mich alarmiert (pn Bot) wenn ich angeschrieben werde und mich bei einer bestimmten Prozentzahl meines Lebens und Mana automatisch Healt. Hier der Bot: #include <Sound.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3>



All times are GMT +1. The time now is 05:50.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.