1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

常に全面にいる簡易メモ帳をPowerShellのワンライナーで実現

Last updated at Posted at 2025-05-22

これ

Add-Type -AssemblyName System.Windows.Forms; $f=New-Object Windows.Forms.Form; $f.Text=' '; $f.FormBorderStyle='Sizable'; $tb=New-Object Windows.Forms.TextBox; $tb.Multiline=$true; $tb.Dock='Fill'; $tb.Text='ここを編集'; $f.Controls.Add($tb); $f.TopMost=$true; $fs=12; $tb.Font=New-Object System.Drawing.Font('Meiryo',$fs); $tb.Add_KeyDown({if($_.Control -and $_.KeyCode -eq 'Oemplus'){$global:fs++}elseif($_.Control -and $_.KeyCode -eq 'OemMinus'){$global:fs--}; if($global:fs -lt 6){$global:fs=6}; $tb.Font=New-Object System.Drawing.Font('Meiryo',$global:fs)}); $f.ShowDialog()

powershellのワンライナーなので、一回打てばあとはヒストリーからもってくればいいだけ。

image.png

文字の拡縮の機能も付けてるのでこれで十分。タイトルバーを消してミニマムのUIにしようとすると移動やサイズ変更がしづらくなるので結局は普通のウィンドウにするのが無難。

動作している様はこれ

image.png

常に最前面に表示されるので「プレゼン中に指摘があったことをメモ」という用途がしっくり。
あとはスクショをとるときの説明用吹き出し。

PowerShellのワンライナーにこだわっているのは「追加インストールができないPCでの便利ツール」を目指しているから。誰もプレーンテキストをブロックすることはできない。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?