|
-
Jun 18th, 2000, 05:20 PM
#1
Thread Starter
Member
i want to make a dockable application bar,
meaning to make a form that will be always on top, and will also
be on the top part of the screen, reducing the usable part of the screen.
-
Jun 18th, 2000, 06:19 PM
#2
Lively Member
form on top :
'use following code to make/keep a form on top :
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const FLAGS = SWP_NOSIZE Or SWP_NOMOVE
Public Const HWND_TOP = 0
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2
Declare Function SetWindowPos Lib "user32.dll" _
(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
Declare Function GetPrivateProfileString Lib "kernel32.dll" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Public Sub KeepWindowOnTop(handle)
'Keeps the window with handle hWnd on top
Dim result%
result% = SetWindowPos(handle, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
If result <> 1 Then
MsgBox "keep window on top failed"
End If
End Sub 'KeepWindowOnTop
Public Sub RemoveWindowFromTop(handle)
'Removes the window with handle hWnd from top
Dim result
result = SetWindowPos(handle, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
If result <> 1 Then
MsgBox "remove from top failed"
End If
End Sub
' good luck
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
|