确实可以用bat替代这个软件,系统自带的命令行power | | | | | $list=@( | | 'C:\01_项目AA2' | | 'C:\01_项目AA2' | | 'C:\01_项目AA2' | | ) | | | | Add-Type -AssemblyName System.Windows.Forms | | Add-Type @' | | using System; | | using System.Runtime.InteropServices; | | | | public class HK | | { | | [DllImport("user32.dll")] | | public static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint vk); | | [DllImport("user32.dll")] | | public static extern bool GetMessage(ref MSG lpMsg, IntPtr hWnd, uint wMsgFilterMin, uint wMsgFilterMax); | | [StructLayout(LayoutKind.Sequential)] | | public struct MSG | | { | | public IntPtr hwnd; | | public uint message; | | public IntPtr wParam; | | public IntPtr lParam; | | public uint time; | | public int x; | | public int y; | | } | | } | | '@ | | | | $define = for($i=0x70; $i -le 0x79; $i++){ | | [void][HK]::RegisterHotKey(0, $i, 0x4000, $i) | | "{0}{{scb '{1}'; {2}; break}}" -f $i, $list[$i-0x70], '[System.Windows.Forms.SendKeys]::SendWait("^v")' | | } | | $define='switch($msg.wParam){'+($define|out-string)+'}' | | | | $msg = @{} | | while([HK]::GetMessage([ref]$msg, 0, 0, 0) -ne 0){if($msg.message -eq 0x0312){iex $define}}COPY |
|