[Tokyo.pm] 座る CC: さくら

matsumotoya matsumotoya @ om.jalinfotec.co.jp
1999年 8月 29日 (日) 22:47:47 CDT


$B>>K\$G$9!#(B

goichi @ mb.kcom.ne.jp wrote:

> 
> $B$H$j$"$($:!"%P%k!<%s$G<BAu$7$?$i$I$&$7$g$&!)(B
> 

Toplevel $B$rMxMQ$7$F!"0J2<$N$h$&$J<BAu$r$7$F$_$^$7$?!#(B
$B%?%9%/%P!<$h$j>e$KI=<($9$k$H$3$,$^$:$$$i$7$/!"(B
$BH=CG$r#Z%*!<%@!<$r$_$k$3$H$KJQ$($kI,MW$,$"$j$^$9!#(B
$B$=$m$=$m @ Z$j$L$/;;CJ$r$7$J$/$A$c$$$1$^$;$s$,!"(B
hWnd $B$5$($o$+$l$P$$$$$N$G!"#V#B$+$i @ Z$jH4$/$N$r(B
$B$^$:$d$C$F$_$h$&$+$H;W$$$^$9!#(B

$B$"$H(B TODO $B$G$9$,!"(B

$B-!(B Drag&Drop $B$r$$$l$F$_$k!#(B
$B-"(B $B%?%9%/%P!<$K%"%$%3%s$r$$$l$F$_$k!#(B
$B-#(B $B @ _DjItJ,$r$D$/$k!#(B
$B-$(B $B$*OC$G$-$k$h$&$K$9$k!#(B
$B-%(B $B$A$c$s$H(BPerl$B$G @ Z$jH4$1$k$h$&$K$9$k!#(B
$B$J$I$J$I!"$^$@$^$@BgJQ$G$9$%!#(B

$B!t$A$J$_$K(B sakura.gif $B$O(B WMascot $B$+$i$H$j$"$($:GR<Z!#(B

------------------------$B$3$3$+$i(B 
use Tk;
use Win32::GUI;
use Win32::API;
use Tk::Dialog;


# $B#D#O#SAk$N>C5n(B
#($DOShwnd, $DOShinstance) = GUI::GetPerlWindow();
#GUI::Hide($DOShwnd);

$SetWindowRgn  = new Win32::API("user32","SetWindowRgn",[N,N,I],N);
$SetWindowPos = new
Win32::API("user32","SetWindowPos",[N,N,N,N,N,N,N],N);
$SendMessage  = new Win32::API("user32","SendMessageA" ,[N,N,N,N],N);
#
#  Main
#
$mw_title = "sakura";
$mw = new MainWindow;
$mw->title($mw_title);

$tw = $mw->Toplevel();
$tw->title("sakura_say");
$tw->overrideredirect(1);
$tw->Text(-font => "{MS $B%4%7%C%/(B} 9",
          -width  => 16,
          -height => 7,-borderwidth => 0,)->pack;

$mw->Photo('imggif',-file => "sakura.gif");
my $c = $mw->Label('-image' => 'imggif')->pack;
$mw->after(200,\&start);
$mw->bind('<Button-2>',sub { exit; });
MainLoop;

sub start
{   
   $top2  = 0;
   $topw2 = 0;
   
   $desktop = GUI::GetDesktopWindow();
   $TrayWnd = GUI::FindWindow("Shell_TrayWnd","");
   $window  = GUI::FindWindow("TkToplevel","sakura");
   $saywin  = GUI::FindWindow("TkToplevel","sakura_say");
   $tmp = GUI::SetWindowLong($window,-16,hex("160B0008"));  
   $tmp = GUI::Resize($window,103,157);
   $tmp = $SetWindowPos->Call($window,-1,0,0,0,0,3);
  
   # print sprintf "%lx\n",GUI::GetWindowLong($saywin,-16);
   $tmp = GUI::SetWindowLong($saywin,-16,hex("96000008"));  
   $tmp = $SetWindowPos->Call($saywin,-1,0,0,0,0,3);
   # print sprintf "%lx\n",GUI::GetWindowLong($saywin,-16);
   

   $mw->Tk::bind("<Button-1>", [\&button_down, Ev('x'), Ev('y')]);
   
   $mw->after(200,\&swaru);
}
sub swaru
{
   ($left,$top,$right,$bottom) = GUI::GetWindowRect($TrayWnd);
   if ($top2 != $top ){
      update();
   }
   $topw = GUI::GetTopWindow($desktop);
   if ($topw2 != $topw){
     print $topw; print "\n"
     #$tmp = $SetWindowPos->Call($window,-1,0,0,0,0,3);
   }
   $top2  = $top;
   $topw2 = $topw;
   $mw->after(500,\&swaru);
}
sub button_down
{
   $tmp = GUI::ReleaseCapture($window);
   $tmp = GUI::SendMessage($window,161,2,0);
   update();
}
sub update
{
   my ($xpos,$t,$r,$b) = GUI::GetWindowRect($window);
   my  $ypos = $top-157+50;
   
   $tmp = GUI::Move($window,$xpos,$ypos); 
   if ($xpos > 120){
      $xpos -= 105;
   }
   else{
      $xpos += 110;
   }
   $tmp = GUI::Move($saywin,$xpos,$ypos);
}



Tokyo-pm メーリングリストの案内