How do I make the window of my application stays on top of the screen permanently even though other application launch later ?
Thanks.
Printable View
How do I make the window of my application stays on top of the screen permanently even though other application launch later ?
Thanks.
SetWindowPos API. Post this code into a form:
VB 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 HWND_TOPMOST = -1 Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const SWP_STAY_AS_IS = SWP_NOMOVE Or SWP_NOSIZE Private Sub Form_Load() SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_STAY_AS_IS End Sub