[Tutorial] How to make a dot crosshair. (Different to w00t?'s tutorial.)
Ok first add this into your module or make another module and add this:
Code:
Private Declare Function SetWindowPos Lib "user32" _
(ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, _
ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const HWND_TOPMOST = -1
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
Public Function PutWindowOnTop (pFrm as Form)
Dim lngWindowPosition As Long
LngWindowPosition = SetWindowPos(pFrm.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)
End Function
Now make a new form, go to properties, BackColor, Palette and pick the color you want (The color you choose will be the color of your crosshair.):
Still in properties find BoderStyle and change it to 0 - None:
Now find StartUpPosition and change it to 2 - CenterScreen:
Now with the background of your form make it into a dot by making it smaller:
After doing all that go to your 1st/main form.
If you want buttons:
Make two buttons for On and Off.
Code for the On Button:
Code:
Call PutWindowOnTop(Form2)
Form2.Show
Code for the Off button:
Code:
Call PutWindowOnTop(Form2)
Form2.Hide
If you want hotkeys then make two timers.
The first timer:
Code:
If GetKeyPress(vbKeyControl) And GetKeyPress(vbKeyC) Then
Call PutWindowOnTop(Form2)
Form2.Show
The second timer:
Code:
If GetKeyPress(vbKeyControl) And GetKeyPress(vbKeyV) Then
Call PutWindowOnTop(Form2)
Form2.Hide
You don't have to use Ctrl + V, C, you can use any hotkey(s) you desire.
Note: Just to remind you that i didn't use ANYTHING from w00t?'s dot crosshair tutorial. I already made this myself and posted this on other forums days ago.
Edit:
I decided to add screenshots incase anyone has trouble with this tutorial.
+rep me if this tutorial was useful/helpful to you.
Credits: wr194t (AKA 5c0tt.)