home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / ch_code / ch13 / wintop / wintop.frm (.txt) next >
Encoding:
Visual Basic Form  |  1996-04-26  |  1.8 KB  |  53 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Always on Top"
  4.    ClientHeight    =   2250
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   5805
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   2250
  10.    ScaleWidth      =   5805
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.Label Label1 
  13.       Caption         =   "This window will remain on top even if you switch to another window.  Try it!"
  14.       BeginProperty Font 
  15.          Name            =   "Verdana"
  16.          Size            =   9.75
  17.          Charset         =   0
  18.          Weight          =   400
  19.          Underline       =   0   'False
  20.          Italic          =   0   'False
  21.          Strikethrough   =   0   'False
  22.       EndProperty
  23.       Height          =   795
  24.       Left            =   135
  25.       TabIndex        =   0
  26.       Top             =   360
  27.       Width           =   5580
  28.    End
  29. Attribute VB_Name = "Form1"
  30. Attribute VB_GlobalNameSpace = False
  31. Attribute VB_Creatable = False
  32. Attribute VB_PredeclaredId = True
  33. Attribute VB_Exposed = False
  34. '  ******************************
  35. '  ******************************
  36. '  ** MASTERING VB6            **
  37. '  ** by Evangelos Petroutos   **
  38. '  ** SYBEX, 1998              **
  39. '  ******************************
  40. '  ******************************
  41. Option Explicit
  42. Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _
  43.     ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, _
  44.     ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  45. Const HWND_TOPMOST = -1
  46. Const SWP_SHOWWINDOW = &H40
  47. Private Sub Form_Load()
  48.     Dim retValue As Long
  49.     Load Form1
  50.     retValue = SetWindowPos(Me.hwnd, HWND_TOPMOST, 100, 200, _
  51.                400, 200, SWP_SHOWWINDOW)
  52. End Sub
  53.