Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. EnumChildWindows?

EnumChildWindows?

Scheduled Pinned Locked Moved Visual Basic
debuggingjsonperformancequestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Knoen
    wrote on last edited by
    #1

    Im trying to enum the childwindows of a application, but when i use the EnumChildWindows in the Windows 32 api i get "A protected area of the memory could not be read" How is it supposed to be done? This is what i have so far. ' Inside main function Call EnumChildWindows(ProcessInfo.Handle, AddressOf EnumFunc, 0) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' The enum func Public Function EnumFunc(ByVal hwnd As Integer, ByVal lpData As Integer) As Integer Dim lResult As Integer Dim sWndName As String Dim szClassName As String EnumFunc = 1 szClassName = Space(MAX_PATH) sWndName = Space(MAX_PATH) lResult = GetClassName(hwnd, szClassName, MAX_PATH) szClassName = Left(szClassName, lResult) GetWindowText(hwnd, sWndName, MAX_PATH) sWndName = Left(sWndName, lResult) Debug.Print(sWndName + Chr(13)) End Function ' Deligate Public Delegate Function EnumFuncDeleg(ByVal hwnd As Integer, ByVal lpData As Integer) As Integer Any ideas? -Thanks

    C 1 Reply Last reply
    0
    • K Knoen

      Im trying to enum the childwindows of a application, but when i use the EnumChildWindows in the Windows 32 api i get "A protected area of the memory could not be read" How is it supposed to be done? This is what i have so far. ' Inside main function Call EnumChildWindows(ProcessInfo.Handle, AddressOf EnumFunc, 0) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' The enum func Public Function EnumFunc(ByVal hwnd As Integer, ByVal lpData As Integer) As Integer Dim lResult As Integer Dim sWndName As String Dim szClassName As String EnumFunc = 1 szClassName = Space(MAX_PATH) sWndName = Space(MAX_PATH) lResult = GetClassName(hwnd, szClassName, MAX_PATH) szClassName = Left(szClassName, lResult) GetWindowText(hwnd, sWndName, MAX_PATH) sWndName = Left(sWndName, lResult) Debug.Print(sWndName + Chr(13)) End Function ' Deligate Public Delegate Function EnumFuncDeleg(ByVal hwnd As Integer, ByVal lpData As Integer) As Integer Any ideas? -Thanks

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Application.OpenWindows, from memory, lets you iterate over the open windows of an app.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups