Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27212

VS 2010 Run Windows Application in background VB (Visual Studio)

$
0
0
Hi everyone. I've made an application that blocks the horizontal movement of the mouse by "mouseposition.x" property. When a keyboard key is pressed, it runs. This is useful to underline words and texts. The problem is that i need to click on the screen, and when I click, the Windows Application stops doing its function beacause it stops being "active".

I need to make the application run all the time even if its minimized or "inactive window".

The application detects keys pressed and the movement of the cursor (X,Y)

Th code:
Code:

Private Sub Form1_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
        If e.KeyCode = Keys.Space Then
            TextBox3.Text = TextBox1.Text
            TextBox4.Text = TextBox2.Text
        End If
        Dim i As Integer

        For i = 0 To 290
            Windows.Forms.Cursor.Position = New Point(TextBox3.Text + i, TextBox4.Text)
        Next
    End Sub

Code:

Private Sub Form1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles Me.KeyPress
        Windows.Forms.Cursor.Position = New Point(TextBox3.Text, TextBox2.Text)
    End Sub

Code:

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        TextBox2.Text = MousePosition.Y
        TextBox1.Text = MousePosition.X
    End Sub

Thanks to everyone who try to help me!

Viewing all articles
Browse latest Browse all 27212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>