|
-
Oct 16th, 2000, 01:33 PM
#1
Thread Starter
Lively Member
How do i make my form ONTOP of those free internet ads, and it stay thatway.
-
Oct 16th, 2000, 01:43 PM
#2
Use the SetWindowPos api function.
Code:
Private Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos"_
(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
Global Const SWP_NOMOVE = 2
Global Const SWP_NOSIZE = 1
Global Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Global Const HWND_TOPMOST = -1
Global Const HWND_NOTOPMOST = -2
Private Sub Form_Load()
Timer1.Interval = 1
End Sub
Private Sub Timer1_Timer()
ontop& = SetWindowPos (Me.hWnd, HWND_TOPMOST, _
0, 0, 0, 0, FLAGS)
End Sub
-
Oct 16th, 2000, 02:09 PM
#3
Thread Starter
Lively Member
i put Declarations in Modules, and put code in form_load and timer1_timer event but when i run the program it tell me that 'SetWindowPos' Sub or Function not defined.
[/code] [/B][/QUOTE]
-
Oct 16th, 2000, 02:21 PM
#4
Code:
Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos"_
(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
-
Oct 16th, 2000, 02:22 PM
#5
Matthew Gates: You don't need to place your code in a Timer, because you will be repeating the same code over and over for nothing. All you really need is to place it in the Load event.
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
Private Sub Form_Load()
SetWindowPos Me.hwnd, -1, 0, 0, 0, 0, 3
End Sub
-
Oct 16th, 2000, 02:36 PM
#6
Oh yeah, silly mistake. Stays on top all the time .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|