From: Robert M. <ro...@th...> - 2008-05-01 22:07:18
|
2008/4/29 Eric M. Hillman <Eri...@dc...>: > I'm trying to build a listbox that will have about the same contents as the > "Applications" tab in Task manager, showing only those apps that have real, > focusable windows. I've been using Win32::GuiTest's "FindWindowLike" with > empty search strings to get a list of windows, but even with a search depth > of 1 I get a lot of what appear to be sub-windows of, say, Winamp or > UltraEdit. How do I filter those out, or is there a better way to be going > about this in the first place? I have code to do this elsewhere - I will post next time I am at the right PC. I think there are a couple of things to test for: Whether the window is top-level or not, and whether the window is visible or not. Possibly some other things too. > Also, a possibly brain-damaged question - is there a canonical way to change > Windows handles (that is, the integers returned by, for example, > Win32::GUI::GetWindow()) into Win32::GUI objects? This seems like it ought > to be simple but I can't even find a useful example of how to do it. Most (but not all) methods that can be invoked on window objects can also be called with a window object or a window handle as a first argument: my $v = $win->IsVisible(); or my $v = Win32::GUI::IsVisible($win); my $v = Win32::GUI::IsVisible($hwnd); Regards, Rob. |