Quantcast
Channel: Programmers Heaven Forums RSS Feed
Viewing all articles
Browse latest Browse all 2703

Program to focus mouse on location and write

$
0
0
Hi, so i am a newb in programming. i Am using Visual Basic 2010 express on Windows 7 64 bit. And i want to make a program.

What the program needs to do is.

When F1 is pushed save mouselocation.
When F2 is Pushed go to previous mouselocation and write the selected item from the combobox at the form.

my hotkeys aren't working and i'm getting a strange error: Pinvokestackim...

This is my code for now. Feel free to add/edit something. I realy need help with. Getting hotkey to work. Then my mouse needs to click. And then he needs to write the selected item. (code is only for the hotkeys atm)


CODE:

Public Class frmLaneCaller
Declare Function SetCursorPos Lib "user32.dll" (ByVal x As Long, ByVal y As Long) As Long
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Short

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'declaration
Dim sngPunt1 As Point, sngPunt2 As Point
Dim hotkey As Boolean, hotkey2 As Boolean
'hotkeys (little declaration)
hotkey = GetAsyncKeyState(Keys.F1)
hotkey2 = GetAsyncKeyState(Keys.F2)
'previous points of mouse
sngPunt1.X = MousePosition.X
sngPunt2.Y = MousePosition.Y



End Sub
End Class

Viewing all articles
Browse latest Browse all 2703

Trending Articles