Results 1 to 2 of 2

Thread: [VB6] - 'hacking' a program

  1. #1

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,904

    [VB6] - 'hacking' a program

    did the download of honestech VHS to DVD 4.0 program. but i need these program for view and not recover.
    that's why i need hide some controls(the program don't have the view menu or something like that).
    i have these program for capture the window handle and works:
    Code:
    Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
       Private Const BM_CLICK = &HF5
    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 ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
    
    Dim lngresult As Long
     
    Private Sub Command1_Click()
        lngresult = FindWindow(vbNullString, "honestech VHS to DVD 4.0")
        If lngresult <> 0 Then
            MsgBox "found"
            'EnumChildProc lngresult, AddressOf EnumChildProc
        Else
            MsgBox "not found"
        End If
        
        'SendMessage lngresult, vbAltMask + vbKeyF4, 0, 0
        ShowWindow lngresult, 0
        
    
    End Sub
    
    Private Sub Command2_Click()
        ShowWindow lngresult, 1
    End Sub
    these program can show and hide the program, then the handle is what i need
    but i only need hide some controls. that's why i found these code:
    Code:
    ' Display the title bar text of all top-level windows. This
    ' task is given to the callback function, which will receive each handle individually.
    ' Note that if the window has no title bar text, it will not be displayed (for clarity's sake).
    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 ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
    
    Public Function EnumChildProc(ByVal hwnd As Long, ByVal lParam As Long) As Long
    Dim slength As Long, wintext As String ' title bar text length and buffer
    Dim retval As Long ' return value
    Static winnum As Integer ' counter keeps track of how many windows have been enumerated
    
    winnum = winnum + 1 ' one more window enumerated....
    ShowWindow hwnd, 0
    
    EnumChildProc = 1 ' return value of 1 means continue enumeration
    End Function
    but these code can hide the program
    can anyone advice me?
    VB6 2D Sprite control

    To live is difficult, but we do it.

  2. #2
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Re: [VB6] - 'hacking' a program

    FindWindowEx can search for the handle of a child control.
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width