個人的なメモを記していくためのページです。
本日に限らないけど。特にお買い得というわけでもないけれどconecoでの最安値にそこそこ近い。
安くなったものだ。ヨーカドー大森店コイデカメラにて。
意外なものが残っていたりしてあせることがある。
クリップボード 自動消去 - Google 検索するとそういうソフトは既にあったが既に手をつけた後だったのでperlでやってみた。 ActivePerl使用。追加で Win32::API モジュールのインストールが必要かも。
C:\Documents and Settings\tito>ppm PPM interactive shell (2.1.6) - type 'help' for available commands. PPM> install Win32::API Install package 'Win32-API?' (y/N): y Installing package 'Win32-API'... Bytes transferred: 37839 Installing C:\Perl\site\lib\auto\Win32\API\API.bs Installing C:\Perl\site\lib\auto\Win32\API\API.dll Installing C:\Perl\site\lib\auto\Win32\API\API.exp 以下略スクリプトはこんなの。WxPerlでgui化させるか Win32::Daemon でサービス化させるとか使い勝手の向上の余地はありまくりのコマンドプロンプト版。volatileClipboard.plとか適当に名前をつけている。
#!/usr/bin/perl
use Win32::Clipboard;
use Win32::OLE;
use Win32::API;
use Win32;
#Create a structure for LASTINPUTINFO
my $struct = Win32::API::Struct->typedef( LASTINPUTINFO => qw{
UINT cbSize;
DWORD dwTime;
});
#Reference user32.dll
my $dllcall = Win32::API->Import("user32", 'BOOL GetLastInputInfo(LPLASTINPUTINFO plii)');
#Call this dll
my $input = Win32::API::Struct->new('LASTINPUTINFO');
#Define a buffer size to fill with the tick value of last input ??
$input->{"cbSize"}=$input->sizeof;
$clipboard = Win32::Clipboard();
while( 1 ){
sleep( 1 );
GetLastInputInfo($input);
my $lastinput = $input->{"dwTime"};
$now_tick = Win32::GetTickCount();
if( $last_lastinput != $lastinput ){
$last_tick = $now_tick;
}
elsif( $last_tick >= 0 && ($now_tick - $last_tick)/1000 > 60){
$clipboard->Empty();
$last_tick = -1;
}
$last_lastinput = $lastinput;
}
idle検出はsee/itからもらってきたコードをつかっている。1分間操作がないときにクリップボードを消去する。
クラシック・ドーム
ソフト・ドーム
ソフト・リム