Results 1 to 6 of 6

Thread: How to see what's running

  1. #1
    spidie_man_home
    Guest

    Question How to see what's running

    Hey guys looking for a little peice of code that will find out what programms are runing. any help would be much appreciated.

  2. #2
    Megatron
    Guest
    Use the EnumWindows function.
    Code:
    Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
    Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
    Declare Function EnumWindows Lib "user32.dll" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
    
    Public Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Long
        Dim Length As Long
        Dim sName As String
        Dim Temp As String
        Static iCount As Integer
        
        iCount = iCount + 1
        Length = GetWindowTextLength(hwnd) + 1
        
        If Length > 1 Then
          sName = Space(Length)
          GetWindowText hwnd, sName, Length
          Debug.Print Left(sName, Length - 1)
        End If
        
        EnumWindowsProc = 1
    End Function
    Usage:
    Code:
    EnumWindows AddressOf EnumWindowsProc, 0

  3. #3
    Hyperactive Member techman2553's Avatar
    Join Date
    Mar 2001
    Location
    <- To your left.
    Posts
    362
    I tried your code, but I get an "Invalid Use of AddressOf Operator" Error for:

    EnumWindows AddressOf EnumWindowsProc, 0

    Any Ideas?
    ----------

  4. #4
    Megatron
    Guest
    Works fine for me. Did you place all of the code in the right place? Put the main function and API declarations in a standard module, and put this line in a button.
    Code:
    EnumWindows AddressOf EnumWindowsProc, 0

  5. #5
    Frenzied Member markman's Avatar
    Join Date
    Nov 2000
    Location
    Florida.
    Posts
    1,197
    Search for something called winkilla at psc. It has what you want
    retired member. Thanks for everything

  6. #6
    Hyperactive Member techman2553's Avatar
    Join Date
    Mar 2001
    Location
    <- To your left.
    Posts
    362
    I don't know what I did, but I cut and pasted the code again and it worked... Thanks !!!
    ----------

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