Okay, I've done it before, but I've lost the source. How do I make a window stay on top always? Any help will be muchly appreciated.
Printable View
Okay, I've done it before, but I've lost the source. How do I make a window stay on top always? Any help will be muchly appreciated.
Use the SetWindowPos API.
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 hwnd, -1, 0, 0, 0, 0, 3
End Sub
What other things can be done with that API function? (except set window the position :)
The API (Application Program Interface) is a set of commands that you can use to access low level operating system functions.
Basically the API allows you to access the operating system directly. This gives the programmer a lot more power and flexibility.
A large library of API exists, allowing you to do all sorts
of things many which are not normally possible using regular VB.
Anything from closing other applications, hiding the task
bar to emptying the recycle bin or closing down windows.
hehe
I think you can only set the window's position, that's why the api's called SetWindowPos huh? :)Quote:
What other things can be done with that API function? (except set window the position :)
That will teach me to speed read the site hu!