|
-
Oct 6th, 2000, 11:09 PM
#1
Thread Starter
Member
Hmm, I cant seem to figure out how I can get my forms to stay on top or infront of all other applications even when they arnt the active window, Help!
-Jeff
Using VB 6.0 Enterprise
I Still like to program on my TI-85!
-
Oct 6th, 2000, 11:56 PM
#2
To keep a form on top:
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
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()
ontop& = SetWindowPos(Me.hWnd, HWND_TOPMOST, _
0, 0, 0, 0, FLAGS)
End Sub
'Off top:
ontop& = SetWindowPos (Me.hWnd, HWND_NOTOPMOST, _
0, 0, 0, 0, FLAGS)
-
Oct 7th, 2000, 12:24 AM
#3
Lively Member
-
Oct 7th, 2000, 12:29 AM
#4
Originally posted by sanon
Another way:
That will work if you are looking to put the form in front of every other form, but it will not work when keeping your application on top of every other application.
-
Oct 26th, 2000, 12:24 PM
#5
Thread Starter
Member
-Jeff
Using VB 6.0 Enterprise
I Still like to program on my TI-85!
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
|