普段あまり Windows は使わない(正確にはブラウザとメーラと PuTTY しか使ってない)のですが、ちょっと思い立ってツールを作るために Ruby を使って Windows のクリップボードの内容を取得する方法を調べてみたところ、1.9 で使える方法が簡単に見つからなかったのでメモしておきます。Windows 上の Ruby は arton さんの ActiveScriptRuby 1.9.1-p378 を対象にしています。 まず 1.8 版での情報はすぐにいくつか見つかります。るびまの第0008号のWin32OLE 活用法の記事より。 http://jp.rubyist.net/magazine/?cmd=view&p=0008-Win32OLE ここでは以下のような選択肢をあげたうえで独自に Win32API を使ってクリップボードを取得するサンプルコードが例示されています。 V