[Tokyo.pm] 座る塗り壁

matsumotoya om.jalinfotec.co.jp matsumotoya om.jalinfotec.co.jp
1999 8 22 () 20:39:57 CDT


> 
> 
> 
> use Tk;
> $mw = new MainWindow;
> $mw->overrideredirect(1);
> $mw->bind("<Enter>", ¥&neru);
> $mw->bind("<Leave>",¥&okiru);
> $mw->bind("<ButtonPress>", sub {exit;});
> $after_id = $mw->after(200, ¥&okiru);
> MainLoop;
> sub okiru{
>   $mw->geometry("+" . $mw->pointerx . "+" . $mw->pointery); 
>   $mw->focusForce;
>   $after_id = $mw->after(200, ¥&okiru);
> }
> sub neru{
>   if ($after_id){
>     $mw->afterCancel($after_id);
>     undef $after_id;
>   }
> }
> 
> 
> 

$mw->overrideredirect(1);




-----  ------------------

use Tk;
use Win32::GUI;
use Win32::API;

#
# ($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 = new MainWindow;
$mw->title("neko");
$mw->overrideredirect(1);

$mw->after(200,¥&start);
MainLoop;

sub start
{
   $desktop = GUI::GetDesktopWindow();
   $TrayWnd = GUI::FindWindow("Shell_TrayWnd","");
   $top2  = 0;
   $topw2 = 0;
   #
   $window = GUI::GetWindow($desktop,GW_CHILD);
   while($window){
      $title = GUI::Text($window);
      last if ($title eq "neko");
      $window = GUI::GetWindow($window,GW_HWNDNEXT);
   }
   #$tmp = GUI::SetWindowLong($window,-16,hex("160B0008"));
   
   $tmp = GUI::Resize($window,64,128);
   $tmp = $SetWindowPos->Call($window,-1,0,0,0,0,3);
   $mw->Tk::bind("<Button-1>", [¥&button_down, Ev('x'), Ev('y')]);
   $mw->after(200,¥&swaru);
}
sub swaru
{
   ($left,$top,$right,$bottom) = GUI::GetWindowRect($TrayWnd);
   $topw = GUI::GetTopWindow($desktop);
   if ($top2 != $top || $topw2 != $topw){
      update();
   }
   $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
{
   $tmp = GUI::Top($window,$top-128+30); 
   $tmp = GUI::Resize($window,64,128);
   $tmp = $SetWindowPos->Call($window,-1,0,0,0,0,3);
}




Tokyo-pm