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

📄 form1.frm

📁 获得编辑框文本
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form Form1 
   Caption         =   "SendMessage Magic"
   ClientHeight    =   3705
   ClientLeft      =   60
   ClientTop       =   375
   ClientWidth     =   7905
   LinkTopic       =   "Form1"
   ScaleHeight     =   3705
   ScaleWidth      =   7905
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton Command1 
      Caption         =   "&Go Get'em"
      Height          =   375
      Left            =   6600
      TabIndex        =   5
      Top             =   3240
      Width           =   1215
   End
   Begin MSComctlLib.ListView View1 
      Height          =   2295
      Left            =   120
      TabIndex        =   4
      Top             =   840
      Width           =   7695
      _ExtentX        =   13573
      _ExtentY        =   4048
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      BorderStyle     =   1
      Appearance      =   1
      NumItems        =   0
   End
   Begin VB.TextBox Text2 
      Height          =   285
      Left            =   3360
      TabIndex        =   3
      Top             =   440
      Width           =   4455
   End
   Begin VB.TextBox Text1 
      Height          =   285
      Left            =   3360
      TabIndex        =   1
      Top             =   80
      Width           =   4455
   End
   Begin VB.Label Label3 
      Caption         =   "http://go.to/abubakar"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   120
      TabIndex        =   6
      ToolTipText     =   "Click here to go to my website"
      Top             =   3360
      Width           =   1695
   End
   Begin VB.Label Label2 
      Caption         =   "Enter Class name(if you dont know leave it :)"
      Height          =   255
      Left            =   120
      TabIndex        =   2
      Top             =   480
      Width           =   3135
   End
   Begin VB.Label Label1 
      Caption         =   "Enter the name of the parent window :"
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   2775
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Hi,
'I wanted to get the contents of edit class of any app I wanted but couldnt
'get any program to do it.I tried Spy++(utility that comes with VC++)but it
'also dont show the contents of edit class, maybe for security reasons :)
'Well I searched and found that my favourite API function SendMessage has
'the power to do just that. In this project I'v demonstrated this.
'A program called WinSight that comes with Borlands'
'Delphi or CBuilder also shows the contents of edit class.

'This project is for the educational purpose only,which demonstrates the use of
'API calls, any use of it is at your own risk and the author takes no
'responsibility of any harm or damages that maybe caused by the use of this
'source code.

'Dont forget to visit my website -> http://go.to/abubakar
'Mail me if you like this code.
'                                             --- Author Muhammad Abubakar
'                                                 <joehacker@yahoo.com>
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias _
    "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As _
    String, ByVal lpFile As String, ByVal lpParameters As String, _
    ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

'My resizing class for sizing controls
Private ClassX As New CResize

Private Sub Command1_Click()
    Dim myLong As Long

    Icount = 1
    View1.ListItems.Clear
    myLong = FindWindow(Text2, Text1)
    myLong = EnumChildWindows(myLong, AddressOf WndEnumChildProc, View1)
    View1.GridLines = True
    
End Sub

Private Sub Form_Load()
    'Although you'v got the resize class with this project but you
    'can also download it from the website where you downloaded this code.
    'That includes detailed project demonstrating the use of this class.
    
    With ClassX
        .hParam = Form1.Height
        .wParam = Form1.Width
        .Map Text1, WidthOnly
        .Map Text2, WidthOnly
        .Map Command1, Top_Left
        .Map View1, Height_Width
        .Map Label3, TopOnly
    End With
    
    View1.View = lvwReport
    View1.ColumnHeaders.Add , , "Handle", 1000
    View1.ColumnHeaders.Add , , "Class Name", 1500
    View1.ColumnHeaders.Add , , "Text", 4500

End Sub

Private Sub Form_Resize()
    'Its that simple :)
    ClassX.rSize Form1
    
End Sub

Private Sub Label3_Click()
    Dim ret As Long
    ret = ShellExecute(Me.hwnd, "Open", "http://go.to/abubakar", "", App.Path, 1)

End Sub

⌨️ 快捷键说明

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