Projects

Find all our projects in development below.
All source code is GNU General Public License (GPL)

Window Spy

Browsing WindowPropForm.frm (54.79 KB)

VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form WindowPropForm 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Window Properties"
   ClientHeight    =   5055
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4095
   ClipControls    =   0   'False
   Icon            =   "WindowPropForm.frx":0000
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5055
   ScaleWidth      =   4095
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.CommandButton Command4 
      Caption         =   "&Apply"
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2880
      TabIndex        =   38
      Top             =   4560
      Width           =   1095
   End
   Begin VB.CommandButton Command3 
      Cancel          =   -1  'True
      Caption         =   "Cancel"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1680
      TabIndex        =   37
      Top             =   4560
      Width           =   1095
   End
   Begin VB.CommandButton Command2 
      Caption         =   "OK"
      Default         =   -1  'True
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   480
      TabIndex        =   36
      Top             =   4560
      Width           =   1095
   End
   Begin VB.PictureBox PictureContainer 
      BorderStyle     =   0  'None
      Height          =   3735
      Index           =   1
      Left            =   360
      ScaleHeight     =   3735
      ScaleWidth      =   3375
      TabIndex        =   40
      TabStop         =   0   'False
      Top             =   600
      Width           =   3375
      Begin VB.TextBox Text8 
         BackColor       =   &H00C0C0C0&
         Height          =   315
         Left            =   960
         Locked          =   -1  'True
         TabIndex        =   5
         Top             =   840
         Width           =   2295
      End
      Begin VB.TextBox Text7 
         BackColor       =   &H00C0C0C0&
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   315
         Left            =   960
         Locked          =   -1  'True
         TabIndex        =   3
         Top             =   480
         Width           =   2295
      End
      Begin VB.CommandButton Command11 
         Caption         =   "&Menu Spy..."
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2160
         TabIndex        =   17
         Top             =   3240
         Width           =   1095
      End
      Begin VB.TextBox Text1 
         BackColor       =   &H00C0C0C0&
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   315
         Left            =   960
         Locked          =   -1  'True
         TabIndex        =   1
         Top             =   120
         Width           =   2295
      End
      Begin VB.TextBox Text2 
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   315
         Left            =   960
         MaxLength       =   6
         TabIndex        =   7
         Top             =   1200
         Width           =   975
      End
      Begin VB.TextBox Text3 
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   315
         Left            =   960
         MaxLength       =   6
         TabIndex        =   9
         Top             =   1560
         Width           =   975
      End
      Begin VB.TextBox Text4 
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   315
         Left            =   960
         MaxLength       =   6
         TabIndex        =   12
         Top             =   1905
         Width           =   2295
      End
      Begin VB.TextBox Text5 
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   315
         Left            =   960
         MaxLength       =   6
         TabIndex        =   14
         Top             =   2260
         Width           =   2295
      End
      Begin VB.TextBox Text6 
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   315
         Left            =   960
         MaxLength       =   256
         TabIndex        =   16
         Top             =   2610
         Width           =   2295
      End
      Begin VB.CommandButton Command1 
         Caption         =   "&Center"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2160
         TabIndex        =   10
         ToolTipText     =   "Center window"
         Top             =   1365
         Width           =   1095
      End
      Begin VB.Label Label8 
         Caption         =   "P&rogram:"
         Height          =   255
         Left            =   120
         TabIndex        =   4
         Top             =   920
         Width           =   615
      End
      Begin VB.Label Label7 
         Caption         =   "&Parent:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   2
         Top             =   550
         Width           =   615
      End
      Begin VB.Line Line2 
         BorderColor     =   &H00FFFFFF&
         X1              =   3240
         X2              =   120
         Y1              =   3135
         Y2              =   3135
      End
      Begin VB.Line Line1 
         BorderColor     =   &H00808080&
         X1              =   3240
         X2              =   120
         Y1              =   3120
         Y2              =   3120
      End
      Begin VB.Label Label1 
         Caption         =   "&Handle:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   0
         Top             =   165
         Width           =   735
      End
      Begin VB.Label Label2 
         Caption         =   "&Left:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   6
         Top             =   1245
         Width           =   735
      End
      Begin VB.Label Label3 
         Caption         =   "&Top:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   8
         Top             =   1605
         Width           =   735
      End
      Begin VB.Label Label4 
         Caption         =   "&Width:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   11
         Top             =   1965
         Width           =   735
      End
      Begin VB.Label Label5 
         Caption         =   "H&eight:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   13
         Top             =   2325
         Width           =   735
      End
      Begin VB.Label Label6 
         Caption         =   "Ca&ption:"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   15
         Top             =   2685
         Width           =   735
      End
   End
   Begin VB.PictureBox PictureContainer 
      BorderStyle     =   0  'None
      Height          =   3735
      Index           =   4
      Left            =   360
      ScaleHeight     =   3735
      ScaleWidth      =   3375
      TabIndex        =   44
      TabStop         =   0   'False
      Top             =   600
      Width           =   3375
      Begin VB.CommandButton Command10 
         Caption         =   "&Click Button"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   720
         TabIndex        =   31
         Top             =   720
         Width           =   1815
      End
      Begin VB.CommandButton Command9 
         Caption         =   "&Unload Window"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   720
         TabIndex        =   30
         Top             =   120
         Width           =   1815
      End
      Begin VB.CommandButton Command8 
         Caption         =   "&Flash Window"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   720
         TabIndex        =   35
         Top             =   2880
         Width           =   1815
      End
      Begin VB.CommandButton Command7 
         Caption         =   "&Restore Window"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   720
         TabIndex        =   34
         Top             =   2280
         Width           =   1815
      End
      Begin VB.CommandButton Command6 
         Caption         =   "&Hide Window"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   720
         TabIndex        =   33
         Top             =   1800
         Width           =   1815
      End
      Begin VB.CommandButton Command5 
         Caption         =   "&Show Window"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   720
         TabIndex        =   32
         Top             =   1320
         Width           =   1815
      End
   End
   Begin MSComctlLib.TabStrip TabStrip1 
      Height          =   4335
      Left            =   120
      TabIndex        =   39
      Top             =   120
      Width           =   3855
      _ExtentX        =   6800
      _ExtentY        =   7646
      _Version        =   393216
      BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628} 
         NumTabs         =   4
         BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "General"
            ImageVarType    =   2
         EndProperty
         BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Appearance"
            ImageVarType    =   2
         EndProperty
         BeginProperty Tab3 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Styles"
            ImageVarType    =   2
         EndProperty
         BeginProperty Tab4 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Commands"
            ImageVarType    =   2
         EndProperty
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.PictureBox PictureContainer 
      BorderStyle     =   0  'None
      Height          =   3735
      Index           =   3
      Left            =   360
      ScaleHeight     =   3735
      ScaleWidth      =   3375
      TabIndex        =   46
      TabStop         =   0   'False
      Top             =   600
      Width           =   3375
      Begin VB.CheckBox Check1 
         Caption         =   "Allow &Style Modifications"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   29
         Top             =   3000
         Width           =   3135
      End
      Begin VB.Frame Frame4 
         Caption         =   "&Extended Window Styles"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   1335
         Left            =   120
         TabIndex        =   27
         Top             =   1560
         Width           =   3135
         Begin VB.ListBox List2 
            Enabled         =   0   'False
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   960
            ItemData        =   "WindowPropForm.frx":000C
            Left            =   120
            List            =   "WindowPropForm.frx":000E
            Style           =   1  'Checkbox
            TabIndex        =   28
            Top             =   240
            Width           =   2895
         End
      End
      Begin VB.Frame Frame3 
         Caption         =   "&Window Styles"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   1335
         Left            =   120
         TabIndex        =   25
         Top             =   120
         Width           =   3135
         Begin VB.ListBox List1 
            Enabled         =   0   'False
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   960
            ItemData        =   "WindowPropForm.frx":0010
            Left            =   120
            List            =   "WindowPropForm.frx":0012
            Style           =   1  'Checkbox
            TabIndex        =   26
            Top             =   240
            Width           =   2895
         End
      End
   End
   Begin VB.PictureBox PictureContainer 
      BorderStyle     =   0  'None
      Height          =   3735
      Index           =   2
      Left            =   360
      ScaleHeight     =   3735
      ScaleWidth      =   3375
      TabIndex        =   41
      TabStop         =   0   'False
      Top             =   600
      Width           =   3375
      Begin VB.Frame Frame2 
         Caption         =   "Always On Top"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   975
         Left            =   120
         TabIndex        =   43
         Top             =   2160
         Width           =   3135
         Begin VB.OptionButton Option3 
            Caption         =   "&False"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   1
            Left            =   240
            TabIndex        =   24
            Top             =   600
            Width           =   2655
         End
         Begin VB.OptionButton Option3 
            Caption         =   "&True"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   0
            Left            =   240
            TabIndex        =   23
            Top             =   360
            Width           =   2655
         End
      End
      Begin VB.Frame Frame1 
         Caption         =   "Window State"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   1935
         Left            =   120
         TabIndex        =   42
         Top             =   120
         Width           =   3135
         Begin VB.PictureBox OptionBox 
            BorderStyle     =   0  'None
            Height          =   495
            Left            =   120
            ScaleHeight     =   495
            ScaleWidth      =   2895
            TabIndex        =   45
            TabStop         =   0   'False
            Top             =   1320
            Width           =   2895
            Begin VB.OptionButton Option2 
               Caption         =   "&Disabled"
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   1
               Left            =   120
               TabIndex        =   22
               Top             =   240
               Width           =   2655
            End
            Begin VB.OptionButton Option2 
               Caption         =   "&Enabled"
               BeginProperty Font 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   255
               Index           =   0
               Left            =   120
               TabIndex        =   21
               Top             =   0
               Width           =   2655
            End
         End
         Begin VB.OptionButton Option1 
            Caption         =   "&Maximized"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   2
            Left            =   240
            TabIndex        =   20
            Top             =   840
            Width           =   2655
         End
         Begin VB.OptionButton Option1 
            Caption         =   "M&inimized"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   1
            Left            =   240
            TabIndex        =   19
            Top             =   600
            Width           =   2655
         End
         Begin VB.OptionButton Option1 
            Caption         =   "&Normal"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Index           =   0
            Left            =   240
            TabIndex        =   18
            Top             =   360
            Width           =   2655
         End
         Begin VB.Line Line5 
            BorderColor     =   &H00808080&
            X1              =   3000
            X2              =   120
            Y1              =   1200
            Y2              =   1200
         End
         Begin VB.Line Line6 
            BorderColor     =   &H00FFFFFF&
            X1              =   3000
            X2              =   120
            Y1              =   1215
            Y2              =   1215
         End
      End
   End
   Begin VB.Menu List1Popupmenu 
      Caption         =   "List1Popupmenu"
      Visible         =   0   'False
      Begin VB.Menu List1SelectAllMenu 
         Caption         =   "Select &All"
      End
      Begin VB.Menu List1SelectNoneMenu 
         Caption         =   "Select &None"
      End
   End
   Begin VB.Menu List2Popupmenu 
      Caption         =   "List2Popupmenu"
      Visible         =   0   'False
      Begin VB.Menu List2SelectAllMenu 
         Caption         =   "Select &All"
      End
      Begin VB.Menu List2SelectNoneMenu 
         Caption         =   "Select &None"
      End
   End
End
Attribute VB_Name = "WindowPropForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Dim wndHandle As Long
Dim bApply As Boolean
Dim WndStyles(129) As LIST_WNDSTYLES
Dim WndStylesEx(20) As LIST_WNDSTYLES

Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type

Private Type LIST_WNDSTYLES
    Caption As String
    Value As Long
End Type

'Private Declare Function BringWindowToTop Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function EnableWindow Lib "user32" (ByVal hWnd As Long, ByVal fEnable As Long) As Long
Private Declare Function FlashWindow Lib "user32" (ByVal hWnd As Long, ByVal bInvert As Long) As Long
'Private Declare Function GetClientRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
Private Declare Function GetMenu Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function GetParent Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd As Long, lpdwProcessId As Long) As Long
Private Declare Function IsIconic Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function IsWindowEnabled Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function IsZoomed Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
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 Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long

Private Const GWL_EXSTYLE = (-20)
Private Const GWL_STYLE = (-16)
Private Const HWND_NOTOPMOST = -2
Private Const HWND_TOPMOST = -1
Private Const SW_HIDE = 0
Private Const SW_NORMAL = 1
Private Const SW_MAXIMIZE = 3
Private Const SW_SHOW = 5
Private Const SW_MINIMIZE = 6
Private Const SW_RESTORE = 9
Private Const VK_SPACE = &H20
Private Const WM_CLOSE = &H10
Private Const WM_GETTEXT = &HD
Private Const WM_GETTEXTLENGTH = &HE
Private Const WM_KEYUP = &H101
Private Const WM_KEYDOWN = &H100
Private Const WM_SETTEXT = &HC

Private Function GetCaption(ByVal hWnd As Long, Optional CaptionLen As Long = -1) As String
Dim CaptionLength As Long
Dim Caption As String
    CaptionLength = GetWindowTextLength(hWnd)
    Caption = String(CaptionLength, Chr(0))
    GetWindowText hWnd, Caption, CaptionLength + 1
    If Caption = "" Then
        CaptionLength = SendMessage(hWnd, WM_GETTEXTLENGTH, 0&, 0&)
        Caption = String(CaptionLength, 0&)
        SendMessageByString hWnd, WM_GETTEXT, CaptionLength + 1, Caption
    End If
    If CaptionLen >= 0 Then CaptionLen = CaptionLength
    GetCaption = Caption
End Function

Private Sub SetPictureContainerIndex(Index As Integer)
Dim i As Integer
    For i = PictureContainer.LBound To PictureContainer.UBound
        PictureContainer(i).Enabled = IIf(Index = i, True, False)
    Next i
    PictureContainer(Index).ZOrder 0
End Sub

Sub SetHandle(ByVal hWnd As Long)
Dim i As Integer
Dim hProcess As Long
Dim wndRect As RECT
Dim wndParentRect As RECT
Dim wndParent As Long
Dim wndStyle As Long
Dim wndStyleEx As Long
    wndHandle = hWnd
    wndStyle = GetWindowLong(wndHandle, GWL_STYLE)
    wndStyleEx = GetWindowLong(wndHandle, GWL_EXSTYLE)
    wndParent = GetParent(wndHandle)
    If GetWindowThreadProcessId(hWnd, hProcess) Then Text8.Text = GetProcessFilename(hProcess)
    Text1.Text = String(8 - Len(CStr(wndHandle)), "0") & wndHandle & " (&H" & Hex(wndHandle) & ")"
    Text7.Text = String(8 - Len(CStr(wndParent)), "0") & wndParent & " (&H" & Hex(wndParent) & ")"
    GetWindowRect wndHandle, wndRect
    GetWindowRect wndParent, wndParentRect
    Text2.Text = wndRect.Left - IIf(wndParent, wndParentRect.Left, 0)
    Text3.Text = wndRect.Top - IIf(wndParent, wndParentRect.Top, 0)
    Text4.Text = wndRect.Right - wndRect.Left
    Text5.Text = wndRect.Bottom - wndRect.Top
    Text6.Text = GetCaption(wndHandle)
    If GetMenu(wndHandle) > 0 Then Command11.Enabled = True
    If IsIconic(wndHandle) Then
        Option1(1).Value = True
    ElseIf IsZoomed(wndHandle) Then
        Option1(2).Value = True
    Else
        Option1(0).Value = True
    End If
    If IsWindowEnabled(wndHandle) Then
        Option2(0).Value = True
    Else
        Option2(1).Value = True
    End If
    For i = LBound(WndStyles) To UBound(WndStyles)
        List1.AddItem WndStyles(i).Caption
        If (wndStyle And WndStyles(i).Value) = WndStyles(i).Value Then List1.Selected(i) = True
    Next i
    List1.ListIndex = -1
    For i = LBound(WndStylesEx) To UBound(WndStylesEx)
        List2.AddItem WndStylesEx(i).Caption
        If (wndStyleEx And WndStylesEx(i).Value) = WndStylesEx(i).Value Then List2.Selected(i) = True
    Next i
    List2.ListIndex = -1
End Sub


Private Sub Check1_Click()
    List1.Enabled = CBool(Check1.Value)
    List2.Enabled = CBool(Check1.Value)
    Command4.Enabled = True
End Sub


Private Sub Command1_Click()
Dim wndRect As RECT
Dim wndParentRect As RECT
Dim wndParent As Long
    wndHandle = Val(Text1.Text)
    wndParent = GetParent(wndHandle)
    If wndParent > 0 Then
        GetWindowRect wndParent, wndParentRect
        Text2.Text = ((wndParentRect.Right - wndParentRect.Left) - Val(Text4.Text)) / 2
        Text3.Text = ((wndParentRect.Bottom - wndParentRect.Top) - Val(Text5.Text)) / 2
    Else
        Text2.Text = ((Screen.Width / Screen.TwipsPerPixelX) - Val(Text4.Text)) / 2
        Text3.Text = ((Screen.Height / Screen.TwipsPerPixelY) - Val(Text5.Text)) / 2
    End If
End Sub


Private Sub Command10_Click()
    SendMessage wndHandle, WM_KEYDOWN, VK_SPACE, vbNullString
    SendMessage wndHandle, WM_KEYUP, VK_SPACE, vbNullString
End Sub

Private Sub Command11_Click()
    If MainForm.GetAOTValue Then WindowOnTop EnumMenusForm.hWnd, True
    EnumMenusForm.Set_hWnd wndHandle
    EnumMenusForm.Tree.Nodes.Clear
    MenuSpy_BuildTree MenuExists(wndHandle), EnumMenusForm.Tree
    If EnumMenusForm.Tree.Nodes.Count = 0 Then
        Unload EnumMenusForm
        MsgBox "No menu items found on the window", vbExclamation, "Menu Spy"
    Else
        EnumMenusForm.Show 1
    End If
End Sub


Private Sub Command2_Click()
Dim i As Integer
Dim AlwaysOnTop As Long
Dim wndStyle As Long
Dim wndStyleEx As Long
    If Option3(0).Value = True Then
        AlwaysOnTop = HWND_TOPMOST
    ElseIf Option3(1).Value = True Then
        AlwaysOnTop = HWND_NOTOPMOST
    Else
        AlwaysOnTop = 0
    End If
    SetWindowPos wndHandle, AlwaysOnTop, Val(Text2.Text), Val(Text3.Text), Val(Text4.Text), Val(Text5.Text), 0&
    SendMessageByString wndHandle, WM_SETTEXT, 0&, Text6.Text
    If Option1(0).Value = True Then
        ShowWindow wndHandle, SW_NORMAL
    ElseIf Option1(1).Value = True Then
        ShowWindow wndHandle, SW_MINIMIZE
    ElseIf Option1(2).Value = True Then
        ShowWindow wndHandle, SW_MAXIMIZE
    End If
    EnableWindow wndHandle, IIf(Option2(0).Value = True, 1&, 0&)
    wndStyle = GetWindowLong(wndHandle, GWL_STYLE)
    wndStyleEx = GetWindowLong(wndHandle, GWL_EXSTYLE)
    If Check1.Value = 1 Then
        MousePointer = vbHourglass
        For i = 0 To List1.ListCount - 1
            If List1.Selected(i) Then wndStyle = wndStyle Or WndStyles(i).Value
            DoEvents
        Next i
        SetWindowLong wndHandle, GWL_STYLE, wndStyle
        For i = 0 To List2.ListCount - 1
            If List2.Selected(i) Then wndStyleEx = wndStyleEx Or WndStylesEx(i).Value
            DoEvents
        Next i
        SetWindowLong wndHandle, GWL_EXSTYLE, wndStyleEx
        MousePointer = vbDefault
    End If
    If bApply Then
        bApply = False
    Else
        Unload Me
    End If
End Sub

Private Sub Command3_Click()
    Unload Me
End Sub


Private Sub Command4_Click()
    bApply = True
    Command4.Enabled = False
    Command2_Click
End Sub

Private Sub Command5_Click()
    ShowWindow wndHandle, SW_SHOW
End Sub

Private Sub Command6_Click()
    ShowWindow wndHandle, SW_HIDE
End Sub


Private Sub Command7_Click()
    ShowWindow wndHandle, SW_RESTORE
End Sub


Private Sub Command8_Click()
    FlashWindow wndHandle, 1&
End Sub

Private Sub Command9_Click()
    If PostMessage(wndHandle, WM_CLOSE, 0&, 0&) Then
        MsgBox "The window was unloaded successfully.", vbExclamation
        Unload Me
    Else
        MsgBox "An error occurred while trying to unload the window.", vbExclamation
    End If
End Sub

Private Sub Form_Load()
    bApply = False
    SetPictureContainerIndex 1
    WndStyles(0).Caption = "WS_BORDER"
    WndStyles(0).Value = &H800000
    WndStyles(1).Caption = "WS_CAPTION"
    WndStyles(1).Value = &HC00000
    WndStyles(2).Caption = "WS_CHILD"
    WndStyles(2).Value = &H40000000
    WndStyles(3).Caption = "WS_CHILDWINDOW"
    WndStyles(3).Value = &H40000000
    WndStyles(4).Caption = "WS_CLIPCHILDREN"
    WndStyles(4).Value = &H2000000
    WndStyles(5).Caption = "WS_CLIPSIBLINGS"
    WndStyles(5).Value = &H4000000
    WndStyles(6).Caption = "WS_DISABLED"
    WndStyles(6).Value = &H8000000
    WndStyles(7).Caption = "WS_DLGFRAME"
    WndStyles(7).Value = &H400000
    WndStyles(8).Caption = "WS_GROUP"
    WndStyles(8).Value = &H20000
    WndStyles(9).Caption = "WS_HSCROLL"
    WndStyles(9).Value = &H100000
    WndStyles(10).Caption = "WS_ICONIC"
    WndStyles(10).Value = &H20000000
    WndStyles(11).Caption = "WS_MAXIMIZE"
    WndStyles(11).Value = &H1000000
    WndStyles(12).Caption = "WS_MAXIMIZEBOX"
    WndStyles(12).Value = &H10000
    WndStyles(13).Caption = "WS_MINIMIZE"
    WndStyles(13).Value = &H20000000
    WndStyles(14).Caption = "WS_MINIMIZEBOX"
    WndStyles(14).Value = &H20000
    WndStyles(15).Caption = "WS_OVERLAPPED"
    WndStyles(15).Value = &H0
    WndStyles(16).Caption = "WS_OVERLAPPEDWINDOW"
    WndStyles(16).Value = &HCF0000
    WndStyles(17).Caption = "WS_POPUP"
    WndStyles(17).Value = &H80000000
    WndStyles(18).Caption = "WS_POPUPWINDOW"
    WndStyles(18).Value = &H80880000
    WndStyles(19).Caption = "WS_SIZEBOX"
    WndStyles(19).Value = &H40000
    WndStyles(20).Caption = "WS_SYSMENU"
    WndStyles(20).Value = &H80000
    WndStyles(21).Caption = "WS_TABSTOP"
    WndStyles(21).Value = &H10000
    WndStyles(22).Caption = "WS_THICKFRAME"
    WndStyles(22).Value = &H40000
    WndStyles(23).Caption = "WS_TILED"
    WndStyles(23).Value = &H0
    WndStyles(24).Caption = "WS_TILEDWINDOW"
    WndStyles(24).Value = &HCF0000
    WndStyles(25).Caption = "WS_VISIBLE"
    WndStyles(25).Value = &H10000000
    WndStyles(26).Caption = "WS_VSCROLL"
    WndStyles(26).Value = &H200000
    WndStyles(27).Caption = "BS_3STATE"
    WndStyles(27).Value = &H5
    WndStyles(28).Caption = "BS_AUTO3STATE"
    WndStyles(28).Value = &H6
    WndStyles(29).Caption = "BS_AUTOCHECKBOX"
    WndStyles(29).Value = &H3
    WndStyles(30).Caption = "BS_AUTORADIOBOX"
    WndStyles(30).Value = &H9
    WndStyles(31).Caption = "BS_BITMAP"
    WndStyles(31).Value = &H80
    WndStyles(32).Caption = "BS_BOTTOM"
    WndStyles(32).Value = &H800
    WndStyles(33).Caption = "BS_CENTER"
    WndStyles(33).Value = &H300
    WndStyles(34).Caption = "BS_CHECKBOX"
    WndStyles(34).Value = &H2
    WndStyles(35).Caption = "BS_DEFPUSHBUTTON"
    WndStyles(35).Value = &H1
    WndStyles(36).Caption = "BS_FLAT"
    WndStyles(36).Value = &H8000
    WndStyles(37).Caption = "BS_GROUPBOX"
    WndStyles(37).Value = &H7
    WndStyles(38).Caption = "BS_ICON"
    WndStyles(38).Value = &H40
    WndStyles(39).Caption = "BS_LEFT"
    WndStyles(39).Value = &H100
    WndStyles(40).Caption = "BS_LEFTTEXT"
    WndStyles(40).Value = &H20
    WndStyles(41).Caption = "BS_MULTILINE"
    WndStyles(41).Value = &H2000
    WndStyles(42).Caption = "BS_NOTIFY"
    WndStyles(42).Value = &H4000
    WndStyles(43).Caption = "BS_OWNERDRAW"
    WndStyles(43).Value = &HB
    WndStyles(44).Caption = "BS_PUSHBUTTON"
    WndStyles(44).Value = &H0
    WndStyles(45).Caption = "BS_PUSHLIKE"
    WndStyles(45).Value = &H1000
    WndStyles(46).Caption = "BS_RADIOBUTTON"
    WndStyles(46).Value = &H4
    WndStyles(47).Caption = "BS_RIGHT"
    WndStyles(47).Value = &H200
    WndStyles(48).Caption = "BS_RIGHTBUTTON"
    WndStyles(48).Value = &H20
    WndStyles(49).Caption = "BS_TEXT"
    WndStyles(49).Value = &H0
    WndStyles(50).Caption = "BS_TOP"
    WndStyles(50).Value = &H400
    WndStyles(51).Caption = "BS_USERBUTTON"
    WndStyles(51).Value = &H8
    WndStyles(52).Caption = "BS_VCENTER"
    WndStyles(52).Value = &HC00
    WndStyles(53).Caption = "CBS_AUTOHSCROLL"
    WndStyles(53).Value = &H40
    WndStyles(54).Caption = "CBS_DISABLENOSCROLL"
    WndStyles(54).Value = &H800
    WndStyles(55).Caption = "CBS_DROPDOWN"
    WndStyles(55).Value = &H2
    WndStyles(56).Caption = "CBS_DROPDOWNLIST"
    WndStyles(56).Value = &H3
    WndStyles(57).Caption = "CBS_HASSTRINGS"
    WndStyles(57).Value = &H200
    WndStyles(58).Caption = "CBS_LOWERCASE"
    WndStyles(58).Value = &H4000
    WndStyles(59).Caption = "CBS_NOINTEGRALHEIGHT"
    WndStyles(59).Value = &H400
    WndStyles(60).Caption = "CBS_OEMCONVERT"
    WndStyles(60).Value = &H80
    WndStyles(61).Caption = "CBS_OWNERDRAWFIXED"
    WndStyles(61).Value = &H10
    WndStyles(62).Caption = "CBS_OWNERDRAWVARIABLE"
    WndStyles(62).Value = &H20
    WndStyles(63).Caption = "CBS_SIMPLE"
    WndStyles(63).Value = &H1
    WndStyles(64).Caption = "CBS_SORT"
    WndStyles(64).Value = &H100
    WndStyles(65).Caption = "CBS_UPPERCASE"
    WndStyles(65).Value = &H2000
    WndStyles(66).Caption = "ES_AUTOHSCROLL"
    WndStyles(66).Value = &H80
    WndStyles(67).Caption = "ES_AUTOVSCROLL"
    WndStyles(67).Value = &H40
    WndStyles(68).Caption = "ES_CENTER"
    WndStyles(68).Value = &H1
    WndStyles(69).Caption = "ES_LEFT"
    WndStyles(69).Value = &H0
    WndStyles(70).Caption = "ES_LOWERCASE"
    WndStyles(70).Value = &H10
    WndStyles(71).Caption = "ES_MULTILINE"
    WndStyles(71).Value = &H4
    WndStyles(72).Caption = "ES_NOHIDESEL"
    WndStyles(72).Value = &H100
    WndStyles(73).Caption = "ES_NUMBER"
    WndStyles(73).Value = &H2000
    WndStyles(74).Caption = "ES_OEMCONVERT"
    WndStyles(74).Value = &H400
    WndStyles(75).Caption = "ES_PASSWORD"
    WndStyles(75).Value = &H20
    WndStyles(76).Caption = "ES_READONLY"
    WndStyles(76).Value = &H800
    WndStyles(77).Caption = "ES_RIGHT"
    WndStyles(77).Value = &H2
    WndStyles(78).Caption = "ES_UPPERCASE"
    WndStyles(78).Value = &H8
    WndStyles(79).Caption = "ES_WANTRETURN"
    WndStyles(79).Value = &H1000
    WndStyles(80).Caption = "LBS_DISABLENOSCROLL"
    WndStyles(80).Value = &H1000
    WndStyles(81).Caption = "LBS_EXTENDEDSEL"
    WndStyles(81).Value = &H800
    WndStyles(82).Caption = "LBS_HASSTRINGS"
    WndStyles(82).Value = &H40
    WndStyles(83).Caption = "LBS_MULTICOLUMN"
    WndStyles(83).Value = &H200
    WndStyles(84).Caption = "LBS_MULTIPLESEL"
    WndStyles(84).Value = &H8
    WndStyles(85).Caption = "LBS_NODATA"
    WndStyles(85).Value = &H2000
    WndStyles(86).Caption = "LBS_NOINTEGRALHEIGHT"
    WndStyles(86).Value = &H100
    WndStyles(87).Caption = "LBS_NOREDRAW"
    WndStyles(87).Value = &H4
    WndStyles(88).Caption = "LBS_NOSEL"
    WndStyles(88).Value = &H4000
    WndStyles(89).Caption = "LBS_NOTIFY"
    WndStyles(89).Value = &H1
    WndStyles(90).Caption = "LBS_OWNERDRAWFIXED"
    WndStyles(90).Value = &H10
    WndStyles(91).Caption = "LBS_OWNERDRAWVARIABLE"
    WndStyles(91).Value = &H20
    WndStyles(92).Caption = "LBS_SORT"
    WndStyles(92).Value = &H2
    WndStyles(93).Caption = "LBS_STANDARD"
    WndStyles(93).Value = &HA00006
    WndStyles(94).Caption = "LBS_USETABSTOPS"
    WndStyles(94).Value = &H80
    WndStyles(95).Caption = "LBS_WANTKEYBOARDINPUT"
    WndStyles(95).Value = &H400
    WndStyles(96).Caption = "SBS_BOTTOMALIGN"
    WndStyles(96).Value = &H4
    WndStyles(97).Caption = "SBS_HORZ"
    WndStyles(97).Value = &H0
    WndStyles(98).Caption = "SBS_LEFTALIGN"
    WndStyles(98).Value = &H2
    WndStyles(99).Caption = "SBS_RIGHTALIGN"
    WndStyles(99).Value = &H4
    WndStyles(100).Caption = "SBS_SIZEBOX"
    WndStyles(100).Value = &H8
    WndStyles(101).Caption = "SBS_SIZEBOXBOTTOMRIGHTALIGN"
    WndStyles(101).Value = &H4
    WndStyles(102).Caption = "SBS_SIZEBOXTOPLEFTALIGN"
    WndStyles(102).Value = &H2
    WndStyles(103).Caption = "SBS_SIZEGRIP"
    WndStyles(103).Value = &H10
    WndStyles(104).Caption = "SBS_TOPALIGN"
    WndStyles(104).Value = &H2
    WndStyles(105).Caption = "SBS_VERT"
    WndStyles(105).Value = &H1
    WndStyles(106).Caption = "SS_BITMAP"
    WndStyles(106).Value = &HE
    WndStyles(107).Caption = "SS_BLACKFRAME"
    WndStyles(107).Value = &H7
    WndStyles(108).Caption = "SS_BLACKRECT"
    WndStyles(108).Value = &H4
    WndStyles(109).Caption = "SS_CENTER"
    WndStyles(109).Value = &H1
    WndStyles(110).Caption = "SS_CENTERIMAGE"
    WndStyles(110).Value = &H200
    WndStyles(111).Caption = "SS_ENHMETAFILE"
    WndStyles(111).Value = &HF
    WndStyles(112).Caption = "SS_ETCHEDFRAME"
    WndStyles(112).Value = &H12
    WndStyles(113).Caption = "SS_ETCHEDHORZ"
    WndStyles(113).Value = &H10
    WndStyles(114).Caption = "SS_ETCHEDVERT"
    WndStyles(114).Value = &H11
    WndStyles(115).Caption = "SS_GRAYFRAME"
    WndStyles(115).Value = &H8
    WndStyles(116).Caption = "SS_GRAYRECT"
    WndStyles(116).Value = &H5
    WndStyles(117).Caption = "SS_ICON"
    WndStyles(117).Value = &H3
    WndStyles(118).Caption = "SS_LEFT"
    WndStyles(118).Value = &H0
    WndStyles(119).Caption = "SS_LEFTNOWORDWRAP"
    WndStyles(119).Value = &HC
    WndStyles(120).Caption = "SS_NOPREFIX"
    WndStyles(120).Value = &H80
    WndStyles(121).Caption = "SS_NOTIFY"
    WndStyles(121).Value = &H100
    WndStyles(122).Caption = "SS_OWNERDRAW"
    WndStyles(122).Value = &HD
    WndStyles(123).Caption = "SS_REALSIZEIMAGE"
    WndStyles(123).Value = &H800
    WndStyles(124).Caption = "SS_RIGHT"
    WndStyles(124).Value = &H2
    WndStyles(125).Caption = "SS_RIGHTJUST"
    WndStyles(125).Value = &H400
    WndStyles(126).Caption = "SS_SIMPLE"
    WndStyles(126).Value = &HB
    WndStyles(127).Caption = "SS_SUNKEN"
    WndStyles(127).Value = &H1000
    WndStyles(128).Caption = "SS_WHITEFRAME"
    WndStyles(128).Value = &H9
    WndStyles(129).Caption = "SS_WHITERECT"
    WndStyles(129).Value = &H6
    WndStylesEx(0).Caption = "WS_EX_ACCEPTFILES"
    WndStylesEx(0).Value = &H10
    WndStylesEx(1).Caption = "WS_EX_APPWINDOW"
    WndStylesEx(1).Value = &H40000
    WndStylesEx(2).Caption = "WS_EX_CLIENTEDGE"
    WndStylesEx(2).Value = &H200
    WndStylesEx(3).Caption = "WS_EX_CONTEXTHELP"
    WndStylesEx(3).Value = &H400
    WndStylesEx(4).Caption = "WS_EX_CONTROLPARENT"
    WndStylesEx(4).Value = &H10000
    WndStylesEx(5).Caption = "WS_EX_DLGMODALFRAME"
    WndStylesEx(5).Value = &H1
    WndStylesEx(6).Caption = "WS_EX_LEFT"
    WndStylesEx(6).Value = &H0
    WndStylesEx(7).Caption = "WS_EX_LEFTSCROLLBAR"
    WndStylesEx(7).Value = &H4000
    WndStylesEx(8).Caption = "WS_EX_LTRREADING"
    WndStylesEx(8).Value = &H0
    WndStylesEx(9).Caption = "WS_EX_MDICHILD"
    WndStylesEx(9).Value = &H40
    WndStylesEx(10).Caption = "WS_EX_NOPARENTNOTIFY"
    WndStylesEx(10).Value = &H4
    WndStylesEx(11).Caption = "WS_EX_OVERLAPPEDWINDOW"
    WndStylesEx(11).Value = &H300
    WndStylesEx(12).Caption = "WS_EX_PALETTEWINDOW"
    WndStylesEx(12).Value = &H188
    WndStylesEx(13).Caption = "WS_EX_RIGHT"
    WndStylesEx(13).Value = &H1000
    WndStylesEx(14).Caption = "WS_EX_RIGHTSCROLLBAR"
    WndStylesEx(14).Value = &H0
    WndStylesEx(15).Caption = "WS_EX_RTLREADING"
    WndStylesEx(15).Value = &H2000
    WndStylesEx(16).Caption = "WS_EX_STATICEDGE"
    WndStylesEx(16).Value = &H20000
    WndStylesEx(17).Caption = "WS_EX_TOOLWINDOW"
    WndStylesEx(17).Value = &H80
    WndStylesEx(18).Caption = "WS_EX_TOPMOST"
    WndStylesEx(18).Value = &H8
    WndStylesEx(19).Caption = "WS_EX_TRANSPARENT"
    WndStylesEx(19).Value = &H20
    WndStylesEx(20).Caption = "WS_EX_WINDOWEDGE"
    WndStylesEx(20).Value = &H100
End Sub

Private Sub List1_ItemCheck(Item As Integer)
    Command4.Enabled = True
End Sub


Private Sub List1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If List1.ListIndex >= 0 Then List1.ToolTipText = List1.List(List1.ListIndex) + ": " + String(10 - Len(CStr(WndStyles(List1.ListIndex).Value)), "0") & WndStyles(List1.ListIndex).Value & " (&H" & Hex(WndStyles(List1.ListIndex).Value) & ")"
End Sub


Private Sub List1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = vbRightButton Then PopupMenu List1Popupmenu, vbPopupMenuRightButton
End Sub


Private Sub List1SelectAllMenu_Click()
Dim i As Integer
Dim i2 As Integer
    MousePointer = vbHourglass
    i2 = List1.ListIndex
    For i = 0 To List1.ListCount - 1
        List1.Selected(i) = True
    Next i
    List1.ListIndex = i2
    MousePointer = vbDefault
End Sub

Private Sub List1SelectNoneMenu_Click()
Dim i As Integer
    MousePointer = vbHourglass
    For i = 0 To List1.ListCount - 1
        List1.Selected(i) = False
    Next i
    MousePointer = vbDefault
End Sub

Private Sub List2_ItemCheck(Item As Integer)
    Command4.Enabled = True
End Sub


Private Sub List2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If List2.ListIndex >= 0 Then List2.ToolTipText = List2.List(List2.ListIndex) + ": " + String(10 - Len(CStr(WndStylesEx(List2.ListIndex).Value)), "0") & WndStylesEx(List2.ListIndex).Value & " (&H" & Hex(WndStylesEx(List2.ListIndex).Value) & ")"
End Sub


Private Sub List2_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = vbRightButton Then PopupMenu List2Popupmenu, vbPopupMenuRightButton
End Sub


Private Sub List2SelectAllMenu_Click()
Dim i As Integer
Dim i2 As Integer
    MousePointer = vbHourglass
    i2 = List2.ListIndex
    For i = 0 To List2.ListCount - 1
        List2.Selected(i) = True
    Next i
    List2.ListIndex = i2
    MousePointer = vbDefault
End Sub

Private Sub List2SelectNoneMenu_Click()
Dim i As Integer
    MousePointer = vbHourglass
    For i = 0 To List2.ListCount - 1
        List2.Selected(i) = False
    Next i
    MousePointer = vbDefault
End Sub

Private Sub Option1_Click(Index As Integer)
    Command4.Enabled = True
End Sub

Private Sub Option2_Click(Index As Integer)
    Command4.Enabled = True
End Sub


Private Sub Option3_Click(Index As Integer)
    Command4.Enabled = True
End Sub


Private Sub TabStrip1_Click()
    SetPictureContainerIndex TabStrip1.SelectedItem.Index
End Sub

Private Sub Text2_Change()
    Command4.Enabled = True
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then Exit Sub
KeyAscii = 0
End Sub


Private Sub Text2_LostFocus()
Text2.Text = Val(Text2.Text)
End Sub


Private Sub Text3_Change()
    Command4.Enabled = True
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then Exit Sub
KeyAscii = 0
End Sub


Private Sub Text3_LostFocus()
Text3.Text = Val(Text3.Text)
End Sub


Private Sub Text4_Change()
    Command4.Enabled = True
End Sub

Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then Exit Sub
KeyAscii = 0
End Sub


Private Sub Text4_LostFocus()
Text4.Text = Val(Text4.Text)
End Sub


Private Sub Text5_Change()
    Command4.Enabled = True
End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then Exit Sub
KeyAscii = 0
End Sub


Private Sub Text5_LostFocus()
Text5.Text = Val(Text5.Text)
End Sub


Private Sub Text6_Change()
    Command4.Enabled = True
End Sub


Download WindowPropForm.frm

Back to file list


Back to project page