Hello to all
I tried this code to find the calculator window
But I have this error
(https://betselection.cc/proxy.php?request=http%3A%2F%2Fi44.tinypic.com%2F2iat06r.jpg&hash=583c6148001d42d7df932b60ff975bba8f6c2180)
What could it be? Thanks
Hello dear friend, what's the actual error output from the compiler?
...let's "spat" this bug! [smiley]cps/up.gif[/smiley]
I've been out for so long
Now I started again the study of VB
I read this old post where there was the code yourself (VLS) entered to create a clicker
ok, the clicker I've already done ...
But I had to do another form to MOVE the window of the casino in an exact position to have ALWAYS
so I always have the usual right coordinates for the bets
Now I would make sure that the window of the casino can put it wherever I want, I remembered your code and I decided to try it, but I got this error
(https://betselection.cc/proxy.php?request=http%3A%2F%2Fi44.tinypic.com%2Frsbklw.png&hash=c893eb33be4c8eb22942291d3388b57b00f19245)
Remember the 6x6? I'm slowly updating with bot ...
this is a video of my test ... :cheer:
http://youtu.be/sUdrtHyOPvs (http://youtu.be/sUdrtHyOPvs)
I think that you have declared you're your GetwindowRect dll import wrong
You have
<DllImport("user32.dll")> _
Private Shared Function GetWindowRect(ByVal hwnd As IntPtr, ByRef lpRect As RECT) As IntPtr
End Function
while it should be
<DllImport("user32.dll")> _
Private Shared Function GetWindowRect(ByVal hwnd As IntPtr, ByRef lpRect As RECT) As Boolean
End Function
Quote from: Cristal2000 on August 22, 2013, 08:13:48 PMBut I had to do another form to MOVE the window of the casino in an exact position to have ALWAYSso I always have the usual right coordinates for the bets
Cristal, if you need to use absolute coordinates, remember you can easily calculate the right coordinates for the target window wherever it is.
If you aimed to have window's position always at:
0,0
But it is currently at:
50,75
And your target X,Y coordinate pair is at:
26,37
You simply need to use:
current left + X, current top + Y
In this case:
50 + 26, 75 + 37
=
76, 112
as your new absolute coordinates pair.
Hello Cristal!
When it will be available on the 6x6 Bot program?
Thank you all .... :cheer:
I managed somehow to find the coordinates of the window casino
in this way:
first memorize the coordinates of the numbers
with the window casino in position 0;0
and then add the value of the coordinates of the ACTUAL POSITION window casino
Imports System.Runtime.InteropServices
<System.Runtime.InteropServices.DllImport("user32.dll")> _
Private Shared Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As System.IntPtr
End Function
Dim casinoHwnd As IntPtr
Dim stRect As RECT
'RECT structure
Structure RECT
Public Left As Integer
Public Top As Integer
Public Right As Integer
Public Bottom As Integer
End Structure
<System.Runtime.InteropServices.DllImport("user32")> _
Private Shared Function GetWindowRect(ByVal hwnd As IntPtr, ByRef lpRect As RECT) As IntPtr
End Function
Sub CoordWINDOW()
casinoHwnd = FindWindow(vbNullString, "Casino Window title")
GetWindowRect(casinoHwnd, stRect)
Label2.Text = stRect.Left '#### COORD LEFT (X) WINDOW CASINO
Label1.Text = stRect.Top '#### COORD TOP (Y) WINDOW CASINO
End Sub
I modified the code
<System.Runtime.InteropServices.DllImport("user32")> _
Private Shared Function GetWindowRect (ByVal hwnd As IntPtr, ByRef lpRect As RECT) As IntPtr
I put: lpRect As RECT
and not: lpRect As Rectangle
because I gave this error:
(https://betselection.cc/proxy.php?request=http%3A%2F%2Fi41.tinypic.com%2F24zx0eh.png&hash=63b044b874f1ae0aeb83afcac9cfe5c36aedb9f9)
Error 1 Can not convert value of type 'WindowsApplication1.TEST.RECT' in 'System.Drawing.Rectangle'.
maybe it's wrong!
but at least something works
small example using the calculator
with the buttons 1, 2, 3, and "+" and "="
I move the window, and always the right button is clicked
http://youtu.be/pcpHcsjMgXM (http://youtu.be/pcpHcsjMgXM)
I then register now coordinates with the window of the casino in position 0 0
and then add the REAL COORDINATES window casino
sorry for my english, I live in Italy
thank you very much :thumbsup:
ok, I'm done ...
I was able, thanks to all ... :cheer: :cheer: :cheer: :cheer: :cheer:
http://youtu.be/FE38icbY3lY (http://youtu.be/FE38icbY3lY)
Congrats dear Cristal [smiley]cps/up.gif[/smiley]
It's very exciting to see your progress.