⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 task_modify.frm

📁 B6 And Windows
💻 FRM
📖 第 1 页 / 共 4 页
字号:
      End
      Begin VB.Menu mnuMoreOptions 
         Caption         =   "More Options..."
      End
   End
   Begin VB.Menu TaskMenu_Items 
      Caption         =   "Selected Item Options"
      Begin VB.Menu TreeMenuRefresh 
         Caption         =   "&Refresh"
      End
      Begin VB.Menu mnuSearchFor 
         Caption         =   "Search For"
         Begin VB.Menu mnuFindByExec 
            Caption         =   "Executable"
         End
         Begin VB.Menu mnuFindByText 
            Caption         =   "Text"
         End
         Begin VB.Menu mnuFindByHandle 
            Caption         =   "Handle"
         End
         Begin VB.Menu mnuFindByFindAgain 
            Caption         =   "Find Again"
            Shortcut        =   {F3}
            Visible         =   0   'False
         End
      End
      Begin VB.Menu TreeMenuShowWindow 
         Caption         =   "&Show Window"
         Begin VB.Menu TreeMenuCProps 
            Caption         =   "&Control Attributes"
         End
         Begin VB.Menu TreeMenuShowMenus 
            Caption         =   "&Menus"
         End
         Begin VB.Menu TreeMenuWindowStyles 
            Caption         =   "&Window Styles"
         End
         Begin VB.Menu TreeMenuListItems 
            Caption         =   "&ListItems"
         End
         Begin VB.Menu TreeMenuProperties 
            Caption         =   "&Property Bag"
         End
      End
      Begin VB.Menu TreeMenuActivate 
         Caption         =   "&Activate"
      End
      Begin VB.Menu mnuseparator1 
         Caption         =   "-"
      End
      Begin VB.Menu TreeMenuEndTask 
         Caption         =   "&Kill Control"
      End
      Begin VB.Menu mnuseparator2 
         Caption         =   "-"
      End
      Begin VB.Menu TreeMenuLaunch 
         Caption         =   "Launch External App"
      End
   End
   Begin VB.Menu mnuFindObj 
      Caption         =   "Find object with mouse"
   End
   Begin VB.Menu mnuSecretOption 
      Caption         =   "Secret Option"
      Visible         =   0   'False
   End
   Begin VB.Menu MnuAbout 
      Caption         =   "About"
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

'Programmed in Win2k. i hope everything is compatable with 9x.

'Set this to False if you would like to Enable Caption changing and being able to resize
'the form with api.
Option Explicit
#Const Stop_Changes = True

'Some of the API procedures defined in this app are unused...

'Right Click on Treeview Items to show the options and commands

'Note: maybe its just a Win2k problem only but on this app do not confuse Desktop(in green) with Progman(The actual desktop window that has icons)
'       I do not know why the are different, but tampering with the desktop(in green)(GetDesktopWindow API) can actually
'       disable the user from doing anything until the computer is restarted.(Progman is started with explorer)


'AuthorMode Is needed to be able to access Write features for this app.

Private Const Evnt_FindNullHwnd  As Long = 1
'constants for CommandButton Width/Height
Private Const bWidth As Long = 1335
Private Const bHeight As Long = 375
Private Const bLeft As Long = 360
Private CPFlag As Boolean 'Used to stop the code from indirectly changing
                          'the index of the combobox and causing events..

Public Property Let AlwaysOnTop(Flg As Boolean)

  Dim HWND_MyFlag As Long

    If Flg Then
        HWND_MyFlag = HWND_TOPMOST
      Else 'NOT FLG...
        HWND_MyFlag = HWND_NOTOPMOST
    End If
    SetWindowPos Me.hwnd, HWND_MyFlag, 0, 0, 0, 0, AOT_Flags
    MnuAOT.Checked = Flg

End Property

Private Sub CPCheck_Click(Index As Integer)

    If AuthorMode Then
        Select Case Index
          Case 0 'Visible
            If CPFlag Then
                '2 min ---- 3 max ---- 4 normal
                ShowWindow SelectedNodeHwnd, CPCheck(0).Value * (GetWindowState(SelectedNodeHwnd) + 2)
                Me.ZOrder
            End If
          Case 1 'Enabled
            SetControlEnabled SelectedNodeHwnd, Abs(CPCheck(1).Value)
        End Select
    End If

End Sub

Private Sub CPCmd_Click(Index As Integer)
'TaskMenuId Windows
'3 Control Propertys

  Dim tmp As Integer

    Select Case Index
      Case 0 'Close Menu
        TaskMenuID = 0
        FrameCP.Visible = False
        TaskTree.Enabled = True

        For tmp = 1 To 17
            Unload CPText(tmp)
            Unload CPLabel(tmp)
        Next tmp
        Unload CPLabel(18)
        Unload CPLabel(19)
        Unload CPCombo(1)
        Unload CPCheck(1)
    End Select

End Sub

Private Sub CPCombo_Click(Index As Integer)

  Dim ProcID As Long

    If AuthorMode Then
        Select Case Index
          Case 0 'WindowState
            If CPFlag Then
                'Set and retrieve the new windowstate.
                CPCombo(0).ListIndex = SetWindowState(SelectedNodeHwnd, CPCombo(0).ListIndex + 2)
                Me.ZOrder 'call ontop for this apps visual safety
            End If
          Case 1 'Process Priority

            Get_Thread_ProcessID SelectedNodeHwnd, ProcID
            CPCombo(1).ListIndex = SetProcessPriority(ProcID, CPCombo(1).ListIndex)
        End Select
    End If

End Sub

Private Sub CPText_GotFocus(Index As Integer)

    If AuthorMode Then
        Select Case Index
          Case 1, 2, 8, 9, 10, 11, 12
            SetPropsText CPText(Index), True, vbBlue
        End Select
    End If

End Sub

Private Sub CPText_KeyPress(Index As Integer, KeyAscii As Integer)

    If AuthorMode Then
  Dim rLeft As Long, rTop As Long, rWidth As Long, rHeight As Long

        If KeyAscii = 13 Then
            Select Case Index
              Case 1 'Caption
                CPText(1).Text = SetText(SelectedNodeHwnd, CPText(1).Text)
                TaskTree.Nodes.item(TaskTree.SelectedItem.Key).Text = CPText(1).Text
              Case 2 'Parent
                CPText(2).Text = AssignParent(SelectedNodeHwnd, CLng(Val(CPText(Index).Text)))
              Case 8 'PWchar
                SetNewPwChar SelectedNodeHwnd, CByte(Val(CPText(8).Text))
              Case 9, 10, 11, 12 '(Top,Left,Width,Height)
                MoveControl SelectedNodeHwnd, CLng(Val(CPText(9).Text)), CLng(Val(CPText(10).Text)), CLng(Val(CPText(11).Text)), CLng(Val(CPText(12).Text))
                GetControlRect SelectedNodeHwnd, rTop, rLeft, rWidth, rHeight
                CPText(9) = rTop
                CPText(10) = rLeft
                CPText(11) = rWidth
                CPText(12) = rHeight
            End Select
        End If
    End If

End Sub

Private Sub CPText_LostFocus(Index As Integer)

    If AuthorMode Then
        Select Case Index
          Case 1, 2, 8, 9, 10, 11, 12
            SetPropsText CPText(Index), True, vbBlack
        End Select
    End If

End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

    If KeyCode = vbKeyF3 And FindAgain Then
        mnuFindByFindAgain_Click
    End If
    If KeyCode = vbKeyShift Then
        mnuSecretOption.Visible = True
    End If

End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyShift Then
        mnuSecretOption.Visible = False
    End If
End Sub

Private Sub Form_Load()

  Dim X As Integer
  Dim LaunchFLen As Integer
  Dim fdir As String
  Dim buff As String
    
'use for compilation - if you'd like to change this look at the constant at the top of this code
#If Stop_Changes = True Then
    NoSizing (Me.hwnd)
    AllowCaptionChange Me.hwnd, False
#End If
    
    RefreshTask
    TaskTree_NodeClick TaskTree.Nodes.item(1)
    'lets open our .dat file now to get our saved variables
    fdir = Dir$(App.Path & "\taskmod.dat")
    If fdir <> "" Then
        Open fdir For Binary As #1
        Get #1, 1, AuthorMode
        Get #1, , Showicons
        Get #1, , SearchForWindows
        Get #1, , LaunchPar
        Get #1, , LaunchFLen
        buff = String$(LaunchFLen, 0)
        Get #1, , buff
        LaunchFile = buff
        Close #1
    End If
    If SearchForWindows Then
        SetTimer Me.hwnd, Evnt_FindNullHwnd, 1000, AddressOf TimerProc
    End If
End Sub

Private Sub Form_Resize()

    If Me.WindowState = vbMaximized Then
        Me.WindowState = vbNormal
    End If
    If Me.WindowState = vbNormal Then
        Me.Width = 9810
        Me.Height = 6675
        TaskTree.Width = 9710
        TaskTree.Height = 6025
    End If

End Sub

Private Sub Form_Unload(Cancel As Integer)

  'TaskMenuID is used becuz of users trying to click the form_close button
  'instead of the Close button provided for them. therefore the form will not
  'close if any options are open.
'TaskMenuId Windows
'1 Window Styles
'2 List Box Propertys
'3 Control Propertys
'4 Menu's
'5 Property Bag
'6 Options

'NOTE TO AUTHOR: if adding/removing buttons; remember that the indexes will change
'                on this function below when trying to close, and in the close subs.
Cancel = True 'stop the Form unload for now
'basically if an option is open, close it, if the main window is showing then end app
Select Case TaskMenuID
    Case 0 'Ok to close form
        'clean up before unload
        LockWindowUpdate Me.hwnd
        AllowCaptionChange Me.hwnd, True
        Unload Me 'unload the main form
        TaskTree.Nodes.Clear 'clear the nodes
        Set TreeX = Nothing ' clear memory
        LockWindowUpdate 0 'unlock view
        Cancel = False 'let the app unload
        End
    Case 1: WSButton_Click 1 ' the 1 is the Index for the close button
    Case 2: LstButton_Click 3 ' the 3 is the index for the close button
    Case 3: CPCmd_Click 0 ' the 0 is the index for the close button
    Case 4: MnuCmd_Click 3 ' the 3 is the index for the close button
    Case 5: PPCmd_Click 3 ' the 3 is the index for the close button
    Case 6: Unload Options 'unload the options form
End Select
End Sub

Private Sub LoadTaskList()

  Dim DeskTophwnd As String
  Dim SWindowText As String
  Dim Nodx As Node
  Dim X As Long
  Dim cur As Long
  Dim tmpcounter As Long
    
    Me.MousePointer = vbHourglass
    tmpcounter = 0
    curhwnd = GetDesktopWindow()
    TreeX.Clear
    DeskTophwnd = CStr(curhwnd)
    SWindowText = Space$(255)
    GetComputerName SWindowText, 255
    SWindowText = Left$(SWindowText, InStr(SWindowText, Chr$(0)) - 1)
    Set Nodx = TaskTree.Nodes.Add(, , "t0", SWindowText)
    Set Nodx = TaskTree.Nodes.Add(, , "t" & DeskTophwnd, "Desktop")
    TaskTree.Nodes.item(1).ForeColor = RGB(0, 175, 0)
    TaskTree.Nodes.item(2).ForeColor = RGB(0, 175, 0)
    GetAllChildren curhwnd
    TreeX.RemoveNode CLng(DeskTophwnd)
    With ImageList1
        .ListImages.Clear
        .ImageHeight = 16
        .ImageWidth = 16
    End With
    For X = 2 To TreeX.GetCount
        cur = CLng(TreeX.GetItem(X))
        Set Nodx = TaskTree.Nodes.Add("t" & CStr(GetParent(cur)), tvwChild, _
            "t" & CStr(cur), GetFriendlyName(cur))
        If Showicons Then
            PicIcon.Cls
            DrawIcon PicIcon.hdc, 0, 0, DetermineBestIcon(cur)
            ImageList1.ListImages.Add , , PicIcon.Image
            Nodx.Image = ImageList1.ListImages.Count
            ''never clear listimages or picture will not appear on treeview
        End If
        If cur = Me.hwnd Then
            Nodx.ForeColor = vbBlue

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -