Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; スクリプト先頭でこう書いておく。ウィンドウ巡回用の初期設定
- GroupAdd launchers, ahk_class ConsoleWindowClass
- #WinActivateForce
- ; Win+Rの設定。コマンドプロンプトがなかったら起動する。そうでなければ切り替える
- ; 連打すると複数あるコマンドプロンプトを巡回できる
- #r::
- ifwinexist ahk_group launchers
- {
- GroupActivate launchers, R
- } else {
- run_launcher()
- }
- return
- ; Shift+Win+Rの設定。巡回とかしないで新しくコマンドプロンプトを起動する
- +#r::run_launcher()
- ; コマンドプロンプトを新しく開く処理
- run_launcher()
- {
- ; lnk拡張子を省略しても起動できるように設定してコマンドプロンプトを起動する。
- run %comspec% /k "prompt $t & set pathext=.lnk;%pathext%", %homepath%, , launcherpid
- ;; 普通にディレクトリ名出してほしいなら上の代わりにこっち
- ;run %comspec% /k "set pathext=.lnk;%pathext%", %homepath%, , launcherpid
- ;; nyaos使うなら上の代わりにこっち
- ; run nyaos.exe, %homepath%, , launcherpid
- ; 以下は起動したウィンドウを定位置に移動する処理
- ; いらなかったら消しておk
- SysGet workarea, MonitorWorkArea
- winwait "ahk_pid %launcherpid%"
- wingetpos, , , , launcher_height
- launcher_height := launcher_height / 2
- winmove "ahk_pid %launcherpid%", , , , , %launcher_height%
- wingetpos, , , , launcher_height
- launcher_y := workareabottom - launcher_height
- winmove "ahk_pid %launcherpid%", , 0, %launcher_y%
- }
Advertisement
Add Comment
Please, Sign In to add comment