Leser: 1
6 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl
use strict;
use warnings;
use Win32;
use Win32::API;
use Win32::API::Callback;
my $EnumWindows = Win32::API->new( "user32", "EnumWindows", "PN", "N" );
my $GetWindowText = Win32::API->new( "user32", "GetWindowText", "NPN", "N" );
my $title = qr/abc/;
my $hwnd = 0;
my $EnumWindowsProc = Win32::API::Callback->new(
sub {
my($acthwnd, $param) = @_;
my $apptitle = ' ' x 256;
my $len = $GetWindowText->Call($acthwnd, $apptitle, length($apptitle)-1);
$apptitle = substr($apptitle, 0, $len);
if ($apptitle =~ $title)
{
$hwnd = $acthwnd;
return 0;
}
return 1;
}, "NN", "N" );
$EnumWindows->Call( $EnumWindowsProc, 0 );
6 Einträge, 1 Seite |