How can I get the HWND appearance of the application list? On Windows Api using C ++

So, I'm trying to make an application to get the contents of a list of my browsers, get text, etc., but here are the problems ...

If I check the Windows Explorer folder (using spy ++) with the list, for testing purposes only I will use a random folder.

It shows me that the title of the window is “FolderView” with the class “SysListView32”, and the top-level window in which this nested list is nested is called the “link”, it is also the title of the Windows Explorer folder in which all the files are.

So what am I doing ..

HWND hWndLV = FindWindow(NULL, TEXT("reference")); // first i get hwnd of the main window, this is where listview window is also nested according to spy++, thats why i do this first. HWND child = FindWindowEx(hWndLV, NULL,NULL,TEXT("FolderView")); // trying to get hwnd of the listview here but it fails, same happens if i also put the class name along as HWND child = FindWindowEx(hWndLV, NULL,TEXT("SysListView32"),TEXT("FolderView")); 

I am using bool test = IsWindow(child); to check for failure, also the VS debugger shows 0x0000000000 every time, so I'm sure I read the results well.

So, I stick with this probably simple thing for most people :(

ps I am on vista64 (if it is anyway)

edit: It seems that this function only works if I'm looking for the first nested level of the parent window I'm looking for. Therefore, I assume that I need a way to access the deep search search for nested levels.

I also tried step by step, defining the hwnd of each parent, then I use findwindowex on it, but oh boy, then I will get to the point where there are 5 nested windows with the same name, and only one of them contains my listview, so cute?

+4
source share
1 answer

If you received a handle to the main window (for example, using FindWindow ), you can list its child windows using EnumChildWindows .

+3
source

Source: https://habr.com/ru/post/1333859/


All Articles