home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / A_P_I__Too406631292001.psc / frmHiddenWins.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-12-07  |  5.3 KB  |  159 lines

  1. VERSION 5.00
  2. Begin VB.Form frmHiddenWins 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Hidden Windows"
  5.    ClientHeight    =   3225
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   2940
  9.    BeginProperty Font 
  10.       Name            =   "Tahoma"
  11.       Size            =   8.25
  12.       Charset         =   0
  13.       Weight          =   400
  14.       Underline       =   0   'False
  15.       Italic          =   0   'False
  16.       Strikethrough   =   0   'False
  17.    EndProperty
  18.    Icon            =   "frmHiddenWins.frx":0000
  19.    LinkTopic       =   "Form1"
  20.    LockControls    =   -1  'True
  21.    MaxButton       =   0   'False
  22.    MinButton       =   0   'False
  23.    ScaleHeight     =   3225
  24.    ScaleWidth      =   2940
  25.    StartUpPosition =   3  'Windows Default
  26.    Begin VB.CommandButton cmdKillWin 
  27.       Caption         =   "Kill Window"
  28.       Height          =   345
  29.       Left            =   1500
  30.       TabIndex        =   2
  31.       Top             =   2790
  32.       Width           =   1245
  33.    End
  34.    Begin VB.CommandButton cmdShowWin 
  35.       Caption         =   "Show Window"
  36.       Height          =   345
  37.       Left            =   270
  38.       TabIndex        =   1
  39.       Top             =   2790
  40.       Width           =   1245
  41.    End
  42.    Begin VB.ListBox lstWins 
  43.       Appearance      =   0  'Flat
  44.       Height          =   1980
  45.       Left            =   90
  46.       TabIndex        =   0
  47.       Top             =   720
  48.       Width           =   2775
  49.    End
  50.    Begin VB.Label Label1 
  51.       Caption         =   "Click an item to show its information in the main screen.  Double-click it to show the window again."
  52.       Height          =   585
  53.       Left            =   90
  54.       TabIndex        =   3
  55.       Top             =   60
  56.       Width           =   2745
  57.    End
  58. Attribute VB_Name = "frmHiddenWins"
  59. Attribute VB_GlobalNameSpace = False
  60. Attribute VB_Creatable = False
  61. Attribute VB_PredeclaredId = True
  62. Attribute VB_Exposed = False
  63. Option Explicit
  64. '##################################
  65. '    Kill Window
  66. '##################################
  67. Private Sub cmdKillWin_Click()
  68.     Dim DataSplit() As String, ListData As String
  69.     Dim Response
  70.     If lstWins.Text = "" Then
  71.         MsgBox "There is no window to kill!", vbExclamation, "Window Tools Professional"
  72.     Else
  73.         If frmMain.chkKill = 1 Then
  74.             Response = MsgBox("Are you sure you want to kill this parent/window?", vbYesNo, "Window Tools Professional")
  75.             
  76.             If Response = vbYes Then
  77.                 ListData = lstWins.Text
  78.                 DataSplit = Split(ListData, " ")
  79.                 Call SendMessage(DataSplit(0), WM_CLOSE, 0&, 0&)
  80.                 RemoveListItem lstWins.Text
  81.                 
  82.                 If frmMain.lblhwnd.Caption = DataSplit(0) Then
  83.                     ClearMain
  84.                 End If
  85.             ElseIf Response = vbNo Then
  86.                 Exit Sub
  87.             Else
  88.                 Exit Sub
  89.             End If
  90.             
  91.         Else
  92.             ListData = lstWins.Text
  93.             DataSplit = Split(ListData, " ")
  94.             Call SendMessage(DataSplit(0), WM_CLOSE, 0&, 0&)
  95.             RemoveListItem lstWins.Text
  96.             
  97.             If frmMain.lblhwnd.Caption = DataSplit(0) Then
  98.                 ClearMain
  99.             End If
  100.         End If
  101.     End If
  102. End Sub
  103. '##################################
  104. '    Show Hidden Window
  105. '##################################
  106. Private Sub cmdShowWin_Click()
  107.     Dim DataSplit() As String, ListData As String
  108.     If lstWins.Text = "" Then
  109.         MsgBox "There is no window to show!  If you have a list, you must select one first.", vbExclamation, "Window Tools Professional"
  110.     Else
  111.         ListData = lstWins.Text
  112.         DataSplit = Split(ListData, " ")
  113.         ShowWin (CLng(DataSplit(0)))
  114.         RemoveListItem lstWins.Text
  115.     End If
  116. End Sub
  117. Private Sub lstWins_Click()
  118.     ' This function will show the specs of a window someone has hidden
  119.     '   on the main screen.
  120.     Dim DataSplit() As String, ListData As String
  121.         
  122.     If lstWins.Text = "" Then
  123.         Exit Sub
  124.     End If
  125.     ListData = lstWins.Text
  126.     DataSplit = Split(ListData, " ")        ' split up our text to get the right data
  127.     WindowSpyUpdate (CLng(DataSplit(0)))    ' update main screen
  128. End Sub
  129. Private Sub lstWins_DblClick()
  130.     ' the person can also double-click an item to un-hide it!!!
  131.     Dim DataSplit() As String, ListData As String
  132.     If lstWins.Text = "" Then
  133.         MsgBox "There is no window to show!  If you have a list, you must select one first.", vbExclamation, "Window Tools Professional"
  134.     Else
  135.         ListData = lstWins.Text
  136.         DataSplit = Split(ListData, " ")
  137.         ShowWin (CLng(DataSplit(0)))
  138.         RemoveListItem lstWins.Text
  139.     End If
  140. End Sub
  141. Public Sub ShowWin(hWnd As Long)
  142.     ' obvious...
  143.     Call ShowWindow(hWnd, SW_SHOW)
  144. End Sub
  145. Public Sub ClearMain()
  146.     frmMain.lblhwnd.Caption = "[none]"
  147.     frmMain.lblText.Caption = "[none]"
  148.     frmMain.lblClass.Caption = "[none]"
  149.     frmMain.lblParent.Caption = "[none]"
  150.     frmMain.lblParentText.Caption = "[none]"
  151.     frmMain.lblParenthWnd.Caption = "[none]"
  152. End Sub
  153. Private Sub Form_Terminate()
  154.     frmMain.chkHiddenWins = 0
  155. End Sub
  156. Private Sub Form_Unload(Cancel As Integer)
  157.     frmMain.chkHiddenWins = 0
  158. End Sub
  159.