Hi,

I am writing a code that will get all IE Windows and sort them from left to
right.

After so many days, I still could not get this function to properly get the
window ID of all
Internet Explorer windows:

@windows = FindWindowLike(0, "Windows Internet Explorer",0,0,5);
@windows = FindWindowLike(0, "Windows Internet Explorer","");


On some cases, I get to get so many IDs (ie, getting 5 IDs for just 2 opened
IE Windows).
On some cases, I get the right number of IDs (ie, 3 IDs for 3 IE Windows).
However, it appears that I am not setting the window's dimension properly -
it appears that
I am modifying the window within the IE window.

Please find below my code. I appreciate your help.

thanks
Dan

my @windows = FindWindowLike(0, "Windows Internet Explorer",0,0,2);
#my @windows = FindWindowLike(0, "Windows Internet Explorer", "");
#my @windows = GetActiveWindow(0);

my %IE;
for my $id (@windows) {
    my $name = GetWindowText($id);
    next unless $name =~ /Windows Internet Explorer/;
    $IE{$id}{name} = $name;
    ($IE{$id}{x1}, $IE{$id}{y1}, $IE{$id}{x2}, $IE{$id}{y2}) =
GetWindowRect($id);
}
#Sort IE windows according to nearness to the left side
my $x;
my $WIDTH = 320;
foreach my $id (sort {$IE{$a}{x1} <=> $IE{$b}{x1}} keys %IE) {
    printf "%10d (%d,%d) (%d,%d) %s\n", $id, $IE{$id}{x1}, $IE{$id}{y1},
$IE{$id}{x2}, $IE{$id}{y2}, $IE{$id}{name};
    SetWindowPos($id, 0, $x, 0, 320, 700, 0);
    $x += $WIDTH;
}
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to