home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Form1
- Caption = "Always on Top"
- ClientHeight = 2250
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 4950
- LinkTopic = "Form1"
- ScaleHeight = 2250
- ScaleWidth = 4950
- StartUpPosition = 3 'Windows Default
- Begin VB.Label Label1
- Caption = "This window will remain on top even if you switch to another window. Try it!"
- Height = 1575
- Left = 120
- TabIndex = 0
- Top = 360
- Width = 4695
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- 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
- Const HWND_TOPMOST = -1
- Const SWP_SHOWWINDOW = &H40
- Private Sub Form_Load()
- Dim retValue As Long
- retValue = SetWindowPos(Me.hwnd, HWND_TOPMOST, Me.CurrentX, Me.CurrentY, _
- Me.Width, Me.Height, SWP_SHOWWINDOW)
- End Sub
-