m0she
10-18-2007, 07:50 AM
[tut] for making your program on top of everitng it is good if you want to make an undetected crossair by your self
first you need to decler on api :
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
you can declere this on the top of your form before evrithng or to declere this in youre modele
next: write it after the declere in the model :
Private Const HWND_TOPMOST = -1
next: now copy this to your form_load
Dim moshe As Long
moshe = Me.hwnd
SetWindowPos moshe, HWND_TOPMOST, 0, 0, 0, 0, 1
so all the code wil look like this :
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
Private Const HWND_TOPMOST = -1
Private Sub Form_Load()
Dim lForm As Long
lForm = Me.hwnd
'Put form on top
SetWindowPos lForm, HWND_TOPMOST, 0, 0, 0, 0, 1
End Sub
and now you make youre progeam on top of every other program enjoy:)
first you need to decler on api :
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
you can declere this on the top of your form before evrithng or to declere this in youre modele
next: write it after the declere in the model :
Private Const HWND_TOPMOST = -1
next: now copy this to your form_load
Dim moshe As Long
moshe = Me.hwnd
SetWindowPos moshe, HWND_TOPMOST, 0, 0, 0, 0, 1
so all the code wil look like this :
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
Private Const HWND_TOPMOST = -1
Private Sub Form_Load()
Dim lForm As Long
lForm = Me.hwnd
'Put form on top
SetWindowPos lForm, HWND_TOPMOST, 0, 0, 0, 0, 1
End Sub
and now you make youre progeam on top of every other program enjoy:)