TopMost |
Description: | |
This small demonstration shows how to make a form 'always on top', so that other windows do not obscure it. To use just place this code in a standard form. | |
Code: | |
Option Explicit 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_NOSIZE = &H1 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOACTIVATE = &H10 Private Const HWND_TOPMOST = -1 Private Sub Form_Resize() SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, _ SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOACTIVATE End Sub | |
Sample Usage: | |
n/a |