VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Searches all the children of a specified hWnd and returns the matches

Sephectja  (1 Submission)   Windows System Services   VB 6.0   Unknown Difficulty   Sun 1st August 2004   Mon 8th February 2021

Searches all the children of a specified hWnd and returns the matches

API Declarations


'Use this code in your own programs if you need to but please
'leave the first 6 lines of commentation in the General Declarations
' This is released under the GPL Licence which means you can modify, change
' and do what you want with the code under the condition that all credits must
' stay and be left untouched. They API calls are from the Microsoft Windows API
'
' A copy of the GPL is at http://www.gnu.org/copyleft/gpl.html
'
'Use of FindChildHwnd function:
' FindChildHwnd(RootHwnd, Caption, Classname, TargetArray())
' RootHwnd = The hWnd you want to start searching from
' Caption = The caption value of the hWnd value (wildcards are allowed)
' Classname = The classname value of the hWnd (Wildcards are allowed)
' TargetArray = The array that all the hWnd values are returned to (this is done for speed)
'
'Use of GetClass function:
' GetClass(hwnd)
' hwnd = the hWnd Identifier you want the classname from
'
'Use of GetCaption function
' GetCaption(hwnd)
' hwnd = the hWnd Identifier you want the caption from

Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
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 GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long

' GetWindow() Constants
Const GW_HWNDFIRST = 0
Const GW_HWNDLAST = 1
Const GW_HWNDNEXT = 2
Const GW_HWNDPREV = 3
Const GW_OWNER = 4
Const GW_CHILD = 5
Const GW_MAX = 5

Rate Searches all the children of a specified hWnd and returns the matches (1(1 Vote))
Searches all the children of a specified hWnd and returns the matches.bas

Searches all the children of a specified hWnd and returns the matches Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters