- 论坛徽章:
- 0
|
mysqllog 发表于 2012-04-17 14:27 ![]()
回复 8# QQ1921961
稍则修改!
msgcode 换成 WM_MOVE
- #!/usr/bin/perl
- #
- use strict;
- use Win32::GUI qw(WM_MOVING WM_MOVE);
- my $main_win = Win32::GUI::Window->new(
- -name => "W1",
- -title => "W1",
- -pos => [ 100, 100 ],
- -size => [ 300, 200 ],
- );
- my $sub_win = Win32::GUI::Window->new(
- -name => "W2",
- -title => "W2",
- -size => [ 400, 400 ],
- );
- $main_win->Hook(WM_MOVE, \&W1_Moving);
- $main_win->Center();
- $main_win->Show();
- $sub_win->Move($main_win->Left() + $main_win->Width(), $main_win->Top());
- $sub_win->Show();
- Win32::GUI::Dialog();
- exit;
- sub W1_Moving {
- my ($win, $id, $lParam, $type, $msgcode) = @_;
-
- my $x = $main_win->Left() + $main_win->Width();
- my $y = $main_win->Top();
-
- $sub_win->Move($x, $y);
-
- return;
- }
- sub W1_Terminate {
- return -1;
- }
- sub W2_Terminate {
- return -1;
- }
复制代码 |
|