Projects

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

Window Spy

Browsing WindowSettingsForm.frm (8.64 KB)

VERSION 5.00
Begin VB.Form WindowSettingsForm 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Window Settings"
   ClientHeight    =   3255
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   2775
   ClipControls    =   0   'False
   Icon            =   "WindowSettingsForm.frx":0000
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3255
   ScaleWidth      =   2775
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.OptionButton Option1 
      Caption         =   "&Disable Window"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   9
      Left            =   120
      TabIndex        =   9
      Top             =   2280
      Width           =   2415
   End
   Begin VB.OptionButton Option1 
      Caption         =   "&Enable Window"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   8
      Left            =   120
      TabIndex        =   8
      Top             =   2040
      Width           =   2415
   End
   Begin VB.OptionButton Option1 
      Caption         =   "Set Window On Top &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           =   7
      Left            =   120
      TabIndex        =   7
      Top             =   1800
      Width           =   2415
   End
   Begin VB.OptionButton Option1 
      Caption         =   "Set Window On Top &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           =   6
      Left            =   120
      TabIndex        =   6
      Top             =   1560
      Width           =   2415
   End
   Begin VB.CommandButton Command2 
      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            =   1440
      TabIndex        =   11
      Top             =   2760
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "&Change"
      Default         =   -1  'True
      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            =   120
      TabIndex        =   10
      Top             =   2760
      Width           =   1215
   End
   Begin VB.OptionButton Option1 
      Caption         =   "Set WindowState M&aximized"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   5
      Left            =   120
      TabIndex        =   5
      Top             =   1320
      Width           =   2415
   End
   Begin VB.OptionButton Option1 
      Caption         =   "Set WindowState &Minimized"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   4
      Left            =   120
      TabIndex        =   4
      Top             =   1080
      Width           =   2415
   End
   Begin VB.OptionButton Option1 
      Caption         =   "Set WindowState &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           =   3
      Left            =   120
      TabIndex        =   3
      Top             =   840
      Width           =   2415
   End
   Begin VB.OptionButton Option1 
      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          =   255
      Index           =   2
      Left            =   120
      TabIndex        =   2
      Top             =   600
      Width           =   2415
   End
   Begin VB.OptionButton Option1 
      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          =   255
      Index           =   1
      Left            =   120
      TabIndex        =   1
      Top             =   360
      Width           =   2415
   End
   Begin VB.OptionButton Option1 
      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          =   255
      Index           =   0
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   2415
   End
End
Attribute VB_Name = "WindowSettingsForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim CapturedWindow As Long

Private Function GetOptionIndex(OptionObj As Object) As Integer
Dim i As Integer
For i = OptionObj.LBound To OptionObj.UBound
If OptionObj(i).Value = True Then
GetOptionIndex = i
Exit Function
End If
Next i
GetOptionIndex = -1
End Function

Sub SetCapturedWindow(ByVal hWnd As Long)
CapturedWindow = hWnd
End Sub

Private Sub Command1_Click()
Select Case GetOptionIndex(Option1)
Case 0
SetWindowState CapturedWindow, SW_SHOW
Case 1
SetWindowState CapturedWindow, SW_HIDE
Case 2
SetWindowState CapturedWindow, SW_RESTORE
Case 3
SetWindowState CapturedWindow, SW_NORMAL
Case 4
SetWindowState CapturedWindow, SW_MINIMIZE
Case 5
SetWindowState CapturedWindow, SW_MAXIMIZE
Case 6
WindowOnTop CapturedWindow, True
Case 7
WindowOnTop CapturedWindow, False
Case 8
WindowEnabled CapturedWindow, True
Case 9
WindowEnabled CapturedWindow, False
End Select
Unload Me
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

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


Download WindowSettingsForm.frm

Back to file list


Back to project page