Simcoder Posted December 9, 2005 Posted December 9, 2005 Hey everyone, I've been messing around with some of the API's and trying to get them to work. Can anyone show me how I would use the FindWindow and the FindWindowEx Api to get all Windows and the child windows that are currently running on my computer using these two methods. I've got the FindWindow method working if I specify a particular window, (ex Untitled - Notepad). I'm just wondering how do I get all Windows and their appropropriate child windows if I have don't know the names of the windows. Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal lpsz2 As String) As Integer Any help would be greatly appreciated. Thanks in advance. -=Simcoder=- Quote Whatever thy hand findest to do, do it with all thy heart - Jesus
Administrators PlausiblyDamp Posted December 10, 2005 Administrators Posted December 10, 2005 You would need to use the EnumWindows API to get all windows and the EnumChildWindows API for the children. http://www.pinvoke.net/search.aspx?search=enumwindows&namespace=[All] should be of some help. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts