|
-
Apr 29th, 2001, 09:39 AM
#1
Thread Starter
Hyperactive Member
Always on top window ..
Hi,
I have this code to put a form always on top but I don't know how to get it to work.
_________________________________________________
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 SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const HWND_NOTOPMOST = -2
Private Const HWND_TOPMOST = -1
Public Function WinSetFloating(ByVal pHwnd As Long, _
ByVal flOnTop As Boolean) As Boolean
' Sets a window to float or releases it
Dim llngRet As Long
Dim llngMess As Long
If flOnTop = True Then
llngMess = HWND_TOPMOST
Else
llngMess = HWND_NOTOPMOST
End If
llngRet = SetWindowPos(pHwnd, llngMess, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)
If llngRet = 0 Then
Err.Raise APIWinErrors.FLOATING_NOT_SET, "WinSetFloating", _
"Windows has not been set on top."
WinSetFloating = False
Else
WinSetFloating = True
End If
End Function
_______________________________________________
I just copied that code to the code view window.
How can I call that command.
this
________________-
Call WinSetFloating
______________________
won't work.
Please help me..
It is the mark of an instructed mind to rest satisfied with the degree of precision which the nature of the subject admits, and not to seek exactness when only an approximation of the truth is possible.
-Aristotle As quoted in Rapid Development, chapter 8, page 167.
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
|