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 = 5805
- LinkTopic = "Form1"
- ScaleHeight = 2250
- ScaleWidth = 5805
- StartUpPosition = 3 'Windows Default
- Begin VB.Label Label1
- Caption = "This window will remain on top even if you switch to another window. Try it!"
- BeginProperty Font
- Name = "Verdana"
- Size = 9.75
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 795
- Left = 135
- TabIndex = 0
- Top = 360
- Width = 5580
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- ' ******************************
- ' ******************************
- ' ** MASTERING VB6 **
- ' ** by Evangelos Petroutos **
- ' ** SYBEX, 1998 **
- ' ******************************
- ' ******************************
- 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
- Load Form1
- retValue = SetWindowPos(Me.hwnd, HWND_TOPMOST, 100, 200, _
- 400, 200, SWP_SHOWWINDOW)
- End Sub
-