PowerShell で 引数が必要な関数 を作成したい
変数の中にマウスポインタのX、Y座標を格納して置いて
後でmsgboxで表示したり他の事に利用したりしたいのですが
Add-Type -AssemblyName System.Windows.Forms [System.int16]$x = [System.Windows.Forms.Cursor]::Position.X [System.int16]$y = [System.Windows.Forms.Cursor]::Position.Y [System.Windows.Forms.MessageBox]::Show("($x,$y)`r`n")
の様に利用したときは問題ないのですが
Add-Type -AssemblyName System.Windows.Forms [System.int16]$x = [System.Windows.Forms.Cursor]::Position.X [System.int16]$y = [System.Windows.Forms.Cursor]::Position.Y function test($xz,$yz){ [System.Windows.Forms.MessageBox]::Show("($xz,$yz)`r`n") } test $x,$y
の様にファンクションにするとうまく行きません。
どうしたらいいでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/02/17 06:55